torchoutil.nn.modules.tensor module¶
Module versions of tensor functions that do not already exists in PyTorch.
- class Abs(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
abs().- 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 Angle(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
angle().- 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 Exp(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
exp().- 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 Exp2(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
exp2().- 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 FFT(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
fft().- 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 IFFT(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
ifft().- 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 Imag(
- *,
- return_zeros: bool = False,
Bases:
EModuleModule version of
imag().- 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 Interpolate(
- size: int | Tuple[int, ...] | None = None,
- scale_factor: float | Tuple[float, ...] | None = None,
- mode: str = 'nearest',
- align_corners: bool | None = None,
- recompute_scale_factor: bool | None = None,
- antialias: bool = False,
Bases:
EModuleModule version of
interpolate().- 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 Log(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
log().- 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 Log10(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
log10().- 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 Log2(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
log2().- 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 Max(
- dim: int | None = None,
- keepdim: bool = False,
- *,
- return_values: bool = True,
- return_indices: bool | None = None,
Bases:
EModuleModule version of
max().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Mean(
- dim: int | None = None,
- keepdim: bool = False,
- dtype: dtype | None | Literal['default'] | str | DTypeEnum = None,
Bases:
EModuleModule version of
mean().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Min(
- dim: int | None = None,
- keepdim: bool = False,
- *,
- return_values: bool = True,
- return_indices: bool | None = None,
Bases:
EModuleModule version of
min().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Normalize( )[source]¶
Bases:
EModuleModule version of
normalize().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Permute(
- *args: int,
Bases:
EModuleModule version of
permute().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Pow( )[source]¶
Bases:
EModuleModule version of
pow().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Real(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
real().- 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 Repeat(
- *repeats: int,
Bases:
EModuleModule version of
repeat().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 RepeatInterleave( )[source]¶
Bases:
EModuleModule version of
repeat_interleave().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 Reshape(
- *shape: int,
Bases:
EModuleModule version of
reshape().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 TensorTo(
- **kwargs,
Bases:
EModuleModule version of
to().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 ToList(
- *,
- strict_load: bool = False,
- config_to_extra_repr: bool = False,
- device_detect_mode: Literal['proxy', 'first_param', 'none'] = 'first_param',
Bases:
EModuleModule version of
tolist().- 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 Transpose( )[source]¶
Bases:
EModuleModule version of
transpose().- extra_repr() str[source]¶
Set the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- 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 View(
- dtype: dtype,
- /,
- class View( )
- class View(
- *size: int,
Bases:
EModule- 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.