MultiIndexSlicingBlock¶
-
class
maze.perception.blocks.general.multi_index_slicing.
MultiIndexSlicingBlock
(*args: Any, **kwargs: Any)¶ A multi-index-slicing block. This can be used rather than the short hand tensor[…,[a,b]] where [a,b] is the list given as selection indices.
- Parameters
in_keys – One key identifying the input tensors.
out_keys – One key identifying the output tensors.
in_shapes – List of input shapes.
select_dim – The dimension to slice from.
select_idxs – The index or indices to select.
-
forward
(block_input: Dict[str, torch.Tensor]) → Dict[str, torch.Tensor]¶ (overrides
PerceptionBlock
)Forward pass, slicing the input tensor as defined by the selection_dim and select_idxs.
- param block_input
The block’s input dictionary.
- return
The block’s output dictionary.