code: def _try_get_shapes(nets):
      try:
          # Note: this will inspect the workspace for better or worse.
          shapes, _ = workspace.InferShapesAndTypes(nets)
          return shapes
      except Exception as e:
          logging.warning("Failed to compute shapes: %s", e)
          return {}
  
imports: import copy
  import logging
  import os
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace
label_desc: Use image node_id 16 for calling a global function with example usage: _try_get_shapes(nets) and returns: shapes, dict