code: def build_perception_dict():
      """helper function"""
      obs_keys = ["obs_inventory", "obs_screen"]
      in_dict = build_multi_input_dict(
          dims=[[1, 16], [1, 3, 64, 64]], names=obs_keys
      )
  
      perception_dict = dict()
  
      # --- block ---
      net = DenseBlock(
          in_keys="obs_inventory",
          out_keys="obs_inventory_latent",
          in_shapes=[in_dict["obs_inventory"].shape[-1:]],
          hidden_units=[32, 32],
          non_lin=nn.ReLU,
      )
      perception_dict["obs_inventory_latent"] = net
  
      # --- block ---
      net = VGGConvolutionDenseBlock(
          in_keys="obs_screen",
          out_keys="obs_screen_latent",
          in_shapes=[in_dict["obs_screen"].shape[-3:]],
          hidden_channels=[8, 16, 32],
          hidden_units=[32],
          non_lin=nn.ReLU,
      )
      perception_dict["obs_screen_latent"] = net
  
      # --- block ---
      net = ConcatenationBlock(
          in_keys=list(perception_dict.keys()),
          out_keys="concat",
          in_shapes=[(32,), (32,)],
          concat_dim=-1,
      )
      perception_dict["concat"] = net
  
      # --- block ---
      net = LinearOutputBlock(
          in_keys=["concat"],
          out_keys="action_move",
          in_shapes=[(64,)],
          output_units=4,
      )
      perception_dict["action_move"] = net
  
      # --- block ---
      net = LinearOutputBlock(
          in_keys=["concat"],
          out_keys="action_use",
          in_shapes=[(64,)],
          output_units=16,
      )
      perception_dict["action_use"] = net
  
      return in_dict, perception_dict
  
file_path: maze/docs/source/policy_and_value_networks/code_snippets/inference_graph_example.py
imports: from typing import Sequence, Dict
  import torch
  from torch import nn
  from maze.perception.blocks.feed_forward.dense import DenseBlock
  from maze.perception.blocks.general.concat import ConcatenationBlock
  from maze.perception.blocks.inference import InferenceGraph, InferenceBlock
  from maze.perception.blocks.joint_blocks.vgg_conv_dense import VGGConvolutionDenseBlock
  from maze.perception.blocks.output.linear import LinearOutputBlock
  from maze.test.perception.perception_test_utils import build_input_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: build_perception_dict() and returns: in_dict,  perception_dict