MemSaveConv1d

class memsave_torch.nn.MemSaveConv1d(in_channels: int, out_channels: int, kernel_size, stride=1, padding=0, dilation=1, groups: int = 1, bias: bool = True, padding_mode: str = 'zeros', device=None, dtype=None)

MemSaveConv1d.

Inits a Conv1d layer with the given params.

Parameters:
  • in_channels – in_channels

  • out_channels – out_channels

  • kernel_size – kernel_size

  • stride – stride

  • padding – padding

  • dilation – dilation

  • groups – groups

  • bias – bias

  • padding_mode – padding_mode

  • device – device

  • dtype – dtype

forward(input: Tensor) Tensor

Forward pass.

Parameters:

input (torch.Tensor) – Input to the network [B, C_in, H, W]

Returns:

Output [B, C_out, H_out, W_out]

Return type:

torch.Tensor

classmethod from_nn_Conv1d(conv1d: Conv1d)

Converts a nn.Conv1d layer to MemSaveConv1d.

Parameters:

conv1d – The nn.Conv1d layer

Returns:

The MemSaveConv1d object

Return type:

MemSaveConv1d

Hint

The usage is the same as torch.nn.Conv1d

For usage examples, please refer to the linked torch documentation