models.modules.Storage

models.modules.Storage#

class Storage(*args, **kwargs)[source]#

Bases: Module

Stores the forward pass values

It is intended for use in feature pyramids, where you need to get multiple matrices from different places in the network.

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

Methods

forward

Store the input tensor and returns it back

get_storage

Returns the stored tensor

Attributes

training

forward(X: Tensor) Tensor[source]#

Store the input tensor and returns it back

Parameters:

X (torch.Tensor) – Input tensor.

Returns:

Input tensor.

Return type:

torch.Tensor

get_storage() Tensor[source]#

Returns the stored tensor

Returns:

Stored tensor.

Return type:

torch.Tensor