torchoutil.nn.modules.multilabel module¶
- class IndicesToMultihot(
- num_classes: int,
- *,
- padding_idx: int | None = None,
- device: device | None | Literal['default', 'cuda_if_available'] | str | int = None,
- dtype: dtype | None | Literal['default'] | str | DTypeEnum = torch.bool,
Bases:
EModuleFor more information, see
indices_to_multihot().- 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( ) Tensor[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.
- class IndicesToMultinames( )[source]¶
Bases:
Generic[T_Name],ModuleFor more information, see
indices_to_multinames().- 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( ) List[List[T_Name]][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.
- class MultihotToIndices( )[source]¶
Bases:
EModuleFor more information, see
multihot_to_indices().- 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(
- multihot: 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 MultihotToMultinames( )[source]¶
Bases:
Generic[T_Name],ModuleFor more information, see
multihot_to_multinames().- forward(
- multihot: 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 MultinamesToIndices( )[source]¶
Bases:
Generic[T_Name],ModuleFor more information, see
multinames_to_indices().- forward( ) List[List[int]][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.
- class MultinamesToMultihot(
- idx_to_name: Mapping[int, T_Name],
- *,
- device: device | None | Literal['default', 'cuda_if_available'] | str | int = None,
- dtype: dtype | None | Literal['default'] | str | DTypeEnum = torch.bool,
Bases:
Generic[T_Name],ModuleFor more information, see
multinames_to_multihot().- 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( ) Tensor[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.
- class ProbsToIndices( )[source]¶
Bases:
EModuleFor more information, see
probs_to_indices().- forward(
- probs: 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 ProbsToMultihot(
- threshold: float | Tensor,
- *,
- device: device | None | Literal['default', 'cuda_if_available'] | str | int = None,
- dtype: dtype | None | Literal['default'] | str | DTypeEnum = torch.bool,
Bases:
EModuleFor more information, see
probs_to_multihot().- 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(
- probs: 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 ProbsToMultinames( )[source]¶
Bases:
Generic[T_Name],ModuleFor more information, see
probs_to_multinames().- forward(
- probs: 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.