code: def _set_shape(schema, fields_as_dict, batched_output=None):
      # Assign static shape for all tensors
      # Workaround of an issue described here:
      # https://stackoverflow.com/questions/49161316/trailing-x00-characters-in-tensor-when-numpy-string-array-is-returned-from-tf
      for k in fields_as_dict.keys():
          unischema_field = schema.fields[k]
  
          if fields_as_dict[k].get_shape().dims is None:
              if batched_output:
                  shape = (None,) + unischema_field.shape
              else:
                  shape = unischema_field.shape
              # Set static shape
              fields_as_dict[k].set_shape(shape)
  
imports: import datetime
  import sys
  import warnings
  from calendar import timegm
  from collections import OrderedDict, namedtuple
  from decimal import Decimal
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling a global function with example usage: _set_shape(schema, fields_as_dict, batched_output) without return types