xlnstorch.LNSTensor.expand

xlnstorch.LNSTensor.expand#

LNSTensor.expand(*sizes)#

Expands self to the shape sizes. Analogous to

https://docs.pytorch.org/docs/stable/generated/torch.Tensor.expand.html

Parameters:

sizes (int) – The new shape to expand to. If a dimension is set to -1, it will be inferred from the size of the original tensor.

Returns:

A new LNSTensor with the expanded shape. The data is not copied, but the view is adjusted to the new shape.

Return type:

LNSTensor