code: def _GetInputDims(caffe_net):
      input_dims = []
      if caffe_net.input_dim:
          input_dims = caffe_net.input_dim
      elif caffe_net.input_shape:
          input_dims = caffe_net.input_shape[0].dim
      elif caffe_net.layer[0].input_param.shape:
          # getting input dimension from first layer
          input_dims = caffe_net.layer[0].input_param.shape[0].dim
      return input_dims
  
imports: import argparse
  import copy
  import logging
  import re
  import numpy
  from caffe2.proto import caffe2_pb2, caffe2_legacy_pb2
  from caffe.proto import caffe_pb2
  from caffe2.python import core, utils, workspace
  from google.protobuf import text_format
label_desc: Use image node_id 8 for calling a global function with example usage: _GetInputDims(caffe_net) and returns: input_dims