Contents

allocate(as:count:)

Allocates a tensor with existing size and stride populated by Context.tensor(forFunction:argument:fillKnownDynamicShapes:).

Declaration

mutating func allocate<T>(as scalarType: T.Type, count: Int) where T : BNNSScalar

Parameters

  • scalarType:

    The data type.

  • count:

    The allocation size represented by the count of scalarType elements.