Pooling modules

class torch_lattice.nn.modules.pooling.AvgPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]

Bases: Pool3d

class torch_lattice.nn.modules.pooling.GlobalAvgPool(*args, **kwargs)[source]

Bases: Module

Parameters:
forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.pooling.GlobalMaxPool(*args, **kwargs)[source]

Bases: Module

Parameters:
forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.pooling.MaxPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]

Bases: Pool3d

class torch_lattice.nn.modules.pooling.Pool3d(*, mode, kernel_size=2, stride=2, padding=0, dilation=1)[source]

Bases: Module

Local sparse 3D pooling over generated output support.

Parameters:

mode (Literal['sum', 'max', 'avg'])

forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.pooling.SumPool3d(kernel_size=2, stride=2, padding=0, dilation=1)[source]

Bases: Pool3d