mr2.data.bart.to_bart_layout

mr2.data.bart.to_bart_layout(data: Tensor, trailing_dims: Sequence[BartDimension], other_dims: Sequence[BartDimension] | None = None) → Tensor[source]

Arrange an MR2 tensor in BART dimension order.

Parameters:
  • data (Tensor) – Tensor with shape (*other, *trailing).

  • trailing_dims (Sequence[BartDimension]) – BART dimensions of the trailing MR2 dimensions.

  • other_dims (Sequence[BartDimension] | None, default: None) – BART dimensions of the leading MR2 other dimensions, in tensor order. None flattens all other dimensions into BartDimension.BATCH.

Returns:

Tensor with all BART dimensions.