parameters: (self, inputs, batch_size=1, max_seq_len=128)
docstring: Update the model to use static axes instead of dynamic axes for graph inputs.
docstring_summary: Update the model to use static axes instead of dynamic axes for graph inputs.
docstring_tokens: Update the model to use static axes instead of dynamic axes for graph inputs .
function: def use_static_input(self, inputs, batch_size=1, max_seq_len=128):
          """
          Update the model to use static axes instead of dynamic axes for graph inputs.
          """
          for input in self.model.graph.input:
              if input.name in inputs:
                  dim_proto = input.type.tensor_type.shape.dim[0]
                  dim_proto.dim_value = batch_size
                  dim_proto = input.type.tensor_type.shape.dim[1]
                  if dim_proto.HasField('dim_param'):
                      dim_proto.dim_value = max_seq_len
                  elif dim_proto.HasField('dim_value') and dim_proto.dim_value != max_seq_len:
                      raise ValueError(
                          'Unable to set dimension value to {} for axis {} of {}. Contradicts existing dimension value {}.'
                          .format(max_seq_len, 1, input.name, dim_proto.dim_value))
function_tokens: def use_static_input ( self , inputs , batch_size = 1 , max_seq_len = 128 ) : for input in self . model . graph . input : if input . name in inputs : dim_proto = input . type . tensor_type . shape . dim [ 0 ] dim_proto . dim_value = batch_size dim_proto = input . type . tensor_type . shape . dim [ 1 ] if dim_proto . HasField ( 'dim_param' ) : dim_proto . dim_value = max_seq_len elif dim_proto . HasField ( 'dim_value' ) and dim_proto . dim_value != max_seq_len : raise ValueError ( 'Unable to set dimension value to {} for axis {} of {}. Contradicts existing dimension value {}.' . format ( max_seq_len , 1 , input . name , dim_proto . dim_value ) )