torchoutil.nn.modules.numpy module¶
- class NumpyToTensor(
- *,
- device: device | None | Literal['default', 'cuda_if_available'] | str | int = None,
- dtype: dtype | None | Literal['default'] | str | DTypeEnum = None,
Bases:
EModuleFor more information, see
numpy_to_tensor().- forward(
- x: ndarray,
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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class TensorToNumpy( )[source]¶
Bases:
EModuleFor more information, see
tensor_to_numpy().- forward(
- x: Tensor,
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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class ToNumpy( )[source]¶
Bases:
EModuleFor more information, see
to_numpy().- forward( ) ndarray[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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.