Contents

allocate(randomIn:using:shape:batchSize:)

Returns a new array descriptor that’s initialized with random values within the specified range, using the given generator as a source for randomness.

Declaration

static func allocate<Scalar, Generator>(randomIn range: ClosedRange<Scalar>, using generator: inout Generator, shape: BNNS.Shape, batchSize: Int = 1) -> BNNSNDArrayDescriptor where Scalar : BNNSScalar, Scalar : BinaryFloatingPoint, Generator : RandomNumberGenerator, Scalar.RawSignificand : FixedWidthInteger

Parameters

  • range:

    The range in which to create random values.

  • generator:

    The random number generator to use when creating the new random values.

  • shape:

    The shape of n-dimensional array descriptor.

  • batchSize:

    The number of batches of data.

See Also

Allocating and Deallocating Memory