Contents

init(data:shape:stride:)

Creates a BNNSTensor that references the same memory as the specified UnsafeMutableBufferPointer.

Declaration

init<T>(data: UnsafeMutableBufferPointer<T>, shape: [Int], stride: [Int]) where T : BNNSScalar

Parameters

  • data:

    A pointer to the source data.

  • shape:

    The shape of the tensor.

  • stride:

    The stride of the tensor.