public struct TensorHandle<Scalar> where Scalar : _TensorFlowDataTypeCompatible

TensorHandle is the type used by ops. It includes a Scalar type, which compiler internals can use to determine the datatypes of parameters when they are extracted into a tensor program.

  • Declaration

    public init(_owning tensorHandles: UnsafePointer<CTensorHandle>?)
  • Declaration

    public init<C: RandomAccessCollection>(
        _handles: C
    ) where C.Element: _AnyTensorHandle
  • Create a TensorHandle with a closure that initializes the underlying buffer.

    scalarsInitializer receives a buffer with exactly enough capacity to hold the scalars in a tensor with shape shape. scalarsInitializer must initialize the entire buffer, with contiguous scalars in row-major order.

    Declaration

    public init(
        shape: [Int],
        scalarsInitializer: (UnsafeMutablePointer<Scalar>) -> Void
    )
  • The number of dimensions of the Tensor.

    Declaration

    public var rank: Int { get }
  • The shape of the Tensor.

    Declaration

    public var shape: TensorShape { get }