docstr: A class for providing a range of accepted shapes.
  
  Parameters
  ----------
  lower_bound:
      The minimum valid value for the shape.
  
  upper_bound:
      The maximum valid value for the shape.
  
      Set to ``-1`` if there is no upper limit (only works if backend is set to "neuralnetwork").
      When backend is set to "mlprogram" during conversion, -1 is not allowed. A finite
      positive upper bound must be provided.
  
  default:
      The default value that is used for initiating the model, and set in the input shape
      field of the model file.
  
      If set to ``None``, ``lower_bound`` would be used as default.
  
  symbol:
      Optional symbol name for the dim. Autogenerate a symbol name if not specified.
docstr_tok: ["A","class","for","providing","a","range","of","accepted","shapes",".","Parameters","--","--","--","--","--","lower_bound",":","The","minimum","valid","value","for","the","shape",".","upper_bound",":","The","maximum","valid","value","for","the","shape",".","Set","to","``","-1","``","if","there","is","no","upper","limit","(","only","works","if","backend","is","set","to","``","neuralnetwork","''",")",".","When","backend","is","set","to","``","mlprogram","''","during","conversion",",","-1","is","not","allowed",".","A","finite","positive","upper","bound","must","be","provided",".","default",":","The","default","value","that","is","used","for","initiating","the","model",",","and","set","in","the","input","shape","field","of","the","model","file",".","If","set","to","``","None","``",",","``","lower_bound","``","would","be","used","as","default",".","symbol",":","Optional","symbol","name","for","the","dim",".","Autogenerate","a","symbol","name","if","not","specified","."]
code: def __init__(
      self,
      lower_bound: int = 1,
      upper_bound: int = -1,
      default: Optional[int] = None,
      symbol: Optional[str] = None,
  ):
      """
      A class for providing a range of accepted shapes.
  
      Parameters
      ----------
      lower_bound:
          The minimum valid value for the shape.
  
      upper_bound:
          The maximum valid value for the shape.
  
          Set to ``-1`` if there is no upper limit (only works if backend is set to "neuralnetwork").
          When backend is set to "mlprogram" during conversion, -1 is not allowed. A finite
          positive upper bound must be provided.
  
      default:
          The default value that is used for initiating the model, and set in the input shape
          field of the model file.
  
          If set to ``None``, ``lower_bound`` would be used as default.
  
      symbol:
          Optional symbol name for the dim. Autogenerate a symbol name if not specified.
      """
      if symbol is None:
          from coremltools.converters.mil.mil import get_new_symbol
  
          self.symbol = get_new_symbol()
      else:
          from coremltools.converters.mil.mil import Symbol
  
          self.symbol = Symbol(symbol)
      self.lower_bound = lower_bound
      self.upper_bound = upper_bound
  
      if default is None:
          self.default = lower_bound
      else:
          if default < lower_bound:
              raise ValueError(
                  f"Default value {default} is less than minimum value ({lower_bound}) for range"
              )
          if default > upper_bound > 0:
              raise ValueError(
                  f"Default value {default} is greater than maximum value ({upper_bound}) for range"
              )
          self.default = default
  
imports: from enum import Enum
  from typing import Optional
  import numpy
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from coremltools.converters.mil.mil.types.type_mapping import is_builtin, numpy_type_to_builtin_type
label_desc: Use image node_id 1 to create a new RangeDim object  with example: obj = RangeDim(lower_bound, upper_bound, default, symbol)