code: def test_slice_block():
      """perception test"""
      for dims in [[32, 16], [100, 32, 16], [100, 5, 32, 16]]:
          in_dict = build_input_dict(dims=dims)
  
          net = SliceBlock(
              in_keys="in_key",
              out_keys="out_key",
              in_shapes=(32, 16),
              slice_dim=-2,
              slice_idx=-1,
          )
          str(net)
          out_dict = net(in_dict)
  
          assert isinstance(out_dict, Dict)
          assert net.out_shapes() == [out_dict["out_key"].shape[-1:]]
  
file_path: maze/maze/test/perception/blocks/test_general.py
imports: from typing import Dict
  import numpy
  import torch
  from torch import nn
  from maze.perception.blocks.feed_forward.dense import DenseBlock
  from maze.perception.blocks.general.action_masking import ActionMaskingBlock
  from maze.perception.blocks.general.concat import ConcatenationBlock
  from maze.perception.blocks.general.correlation import CorrelationBlock
  from maze.perception.blocks.general.flatten import FlattenBlock
  from maze.perception.blocks.general.gap import GlobalAveragePoolingBlock
  from maze.perception.blocks.general.slice import SliceBlock
  from maze.test.perception.perception_test_utils import build_multi_input_dict, build_input_dict
label_desc: Use image node_id 5 for calling a global function with example usage: test_slice_block() without return types