spyrit.core.meas.DynamicLinear.vectorize

DynamicLinear.vectorize(input: tensor) tensor[source]

Flatten the measured dimensions.

The tensor is flattened at the indicated self.meas_dims dimensions. The collapsed dimensions are then moved to the last dimension of the output tensor. The time dimension is moved to the second-to-last position.

Input:

input (torch.tensor): A tensor whose dimensions given by self.meas_dims have shape self.meas_shape.

Output:

torch.tensor: A tensor of shape (*, self.M, self.meas_shape) where * denotes all the dimensions of the input tensor not included in self.meas_dims.

See also:

For the opposite operation use unvectorize().