Contents

allocate(initializingFrom:)

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

Declaration

mutating func allocate<T>(initializingFrom source: some AccelerateBuffer) where T : BNNSScalar

Parameters

  • source:

    The collection that provides the source elements.

Discussion

This function copies the data in source to the tensor and sets the tensor’s data_type property to that of the source collection’s elements.