code: def test_correlation_block():
      """perception test"""
  
      for d0, d1 in [
          ([100, 16], [100, 16]),
          ([100, 5, 16], [100, 5, 16]),
          ([100, 5, 16], [100, 16]),
          ([100, 16], [100, 5, 16]),
          ([100, 25, 16], [100, 10, 16]),
      ]:
          in_dict = build_multi_input_dict(dims=[d0, d1])
  
          # with out reduction
          net = CorrelationBlock(
              in_keys=["in_key_0", "in_key_1"],
              out_keys="correlation",
              in_shapes=[d0[1:], d1[1:]],
              reduce=False,
          )
          str(net)
          out_dict_no_reduce = net(in_dict)
  
          assert isinstance(out_dict_no_reduce, Dict)
          assert out_dict_no_reduce["correlation"].shape[-1] == 16
          assert net.out_shapes() == [
              out_dict_no_reduce["correlation"].shape[1:]
          ]
  
          # with reduction
          net = CorrelationBlock(
              in_keys=["in_key_0", "in_key_1"],
              out_keys="correlation",
              in_shapes=[d0[1:], d1[1:]],
              reduce=True,
          )
          str(net)
          out_dict_reduce = net(in_dict)
  
          assert isinstance(out_dict_reduce, Dict)
          assert (
              out_dict_reduce["correlation"].ndim + 1
          ) == out_dict_no_reduce["correlation"].ndim
  
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 6 for calling a global function with example usage: test_correlation_block() without return types