pymoose.expand_dims#

pymoose.expand_dims(x, axis, placement=None)[source]#

Expand the rank of x with new singleton dimensions.

Parameters
  • x – The tensor to expand.

  • axis – Index of the new dimension. If a tuple/list, should contain the indices where each new dimension will be expanded.

  • placement – An optional Placement to pin this operation to.

Returns

The expanded tensor, complete with new singleton dimensions.