xlnstorch.LNSTensor.squeeze

xlnstorch.LNSTensor.squeeze#

LNSTensor.squeeze(dim=None)#

Returns a new LNSTensor with all specified dimensions of size 1 removed. If no dimensions are specified, all dimensions of size 1 are removed.

Parameters:

dim (int, list of int, optional) – The dimension(s) to remove. If None, all dimensions of size 1 are removed. Defaults to None.

Returns:

A new LNSTensor with the specified dimensions removed.

Return type:

LNSTensor