class_docstr: Array Data Type
class_docstr_tok: ["Array","Data","Type"]
docstr: Constructs a Array, given its dimensions
  
  Parameters
  ----------
  dimensions: ints | longs
  
  Examples
  --------
  # Create a single dimensions array of length five
  >>> arr = coremltools.models.datatypes.Array(5)
  
  # Create a multi dimension array five by two by ten.
  >>> multi_arr = coremltools.models.datatypes.Array(5, 2, 10)
docstr_tok: ["Constructs","a","Array",",","given","its","dimensions","Parameters","--","--","--","--","--","dimensions",":","ints","|","longs","Examples","--","--","--","--","#","Create","a","single","dimensions","array","of","length","five",">",">",">","arr","=","coremltools.models.datatypes.Array","(","5",")","#","Create","a","multi","dimension","array","five","by","two","by","ten",".",">",">",">","multi_arr","=","coremltools.models.datatypes.Array","(","5",",","2",",","10",")"]
code: def __init__(self, *dimensions):
      """
      Constructs a Array, given its dimensions
  
      Parameters
      ----------
      dimensions: ints | longs
  
      Examples
      --------
      # Create a single dimensions array of length five
      >>> arr = coremltools.models.datatypes.Array(5)
  
      # Create a multi dimension array five by two by ten.
      >>> multi_arr = coremltools.models.datatypes.Array(5, 2, 10)
      """
      assert len(dimensions) >= 1
      assert all(
          isinstance(d, (int, _np.int64, _np.int32)) for d in dimensions
      ), "Dimensions must be ints, not {}".format(str(dimensions))
      self.dimensions = dimensions
  
      num_elements = 1
      for d in self.dimensions:
          num_elements *= d
  
      _DatatypeBase.__init__(
          self,
          "Array",
          "Array({%s})" % (",".join("%d" % d for d in self.dimensions)),
          num_elements,
      )
  
imports: import numpy
  from ..proto import Model_pb2
label_desc: Use image node_id 1 to create a new Array object from inherited base classes: _DatatypeBase with example: obj = Array()