nip.utils.torch.Squeeze

nip.utils.torch.Squeeze#

class nip.utils.torch.Squeeze(dim: int = -1)[source]#

Squeeze a dimension.

Parameters:

dim (int, default=-1) – The dimension to squeeze.

Methods Summary

__init__([dim])

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)

Squeeze the input tensor.

Attributes

T_destination

call_super_init

dump_patches

training

Methods

__init__(dim: int = -1)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x: Tensor) Tensor[source]#

Squeeze the input tensor.

Parameters:

x (Tensor) – The input tensor.

Returns:

x_squeezed (Tensor) – The input tensor with the specified dimension squeezed.