nip.utils.torch.GlobalMaxPool

nip.utils.torch.GlobalMaxPool#

class nip.utils.torch.GlobalMaxPool(dim: int = -1, keepdim: bool = False)[source]#

Global max pooling layer over a dimension.

Parameters:
  • dim (int, default=-1) – The dimension to pool over.

  • keepdim (bool, default=False) – Whether to keep the pooled dimension or not.

Methods Summary

__init__([dim, keepdim])

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

forward(x)

Apply global max pooling to the input tensor.

Attributes

T_destination

call_super_init

dump_patches

training

Methods

__init__(dim: int = -1, keepdim: bool = False)[source]#

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

forward(x: Tensor) Tensor[source]#

Apply global max pooling to the input tensor.

Parameters:

x (Tensor) – The input tensor.

Returns:

Tensor – The output tensor after global max pooling.