utils
Internal module for utility functions.
Functions
Get the tensor based on the slices. |
|
Get the tensor based on the active slice. |
- get_sliced_tensor(mod, tensor, *hp_names)
Get the tensor based on the slices.
- Parameters:
mod (DynamicModule) –
tensor (Tensor | None) –
hp_names (str | None) –
- Return type:
Tensor | None
- get_sliced_tensor_by_slices(tensor, slices)
Get the tensor based on the active slice.
- Parameters:
tensor (Tensor | None) –
slices (List[slice | LongTensor]) –
- Return type:
Tensor | None