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,
        )

        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)
        
coremltools/models/datatypes.py