utils

Internal module for utility functions.

Functions

get_sliced_tensor

Get the tensor based on the slices.

get_sliced_tensor_by_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