public struct TensorHandle<Scalar> where Scalar : _TensorFlowDataTypeCompatible
extension TensorHandle: TensorGroup

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 cTensorHandle: CTensorHandle)
  • Declaration

    public init(handle: _AnyTensorHandle)
  • Declaration

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

    public init<C: RandomAccessCollection>(
        _handles: C
    ) where C.Element: _AnyTensorHandle
  • The number of dimensions of the Tensor.


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


    public var shape: TensorShape { get }
  • 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.


    public init(
        shape: [Int],
        scalarsInitializer: (UnsafeMutablePointer<Scalar>) -> Void