TensorArrayProtocol

public protocol TensorArrayProtocol

A protocol representing types that can be mapped to Array<CTensorHandle>.

This protocol is defined separately from TensorGroup in order for the number of tensors to be determined at runtime. For example, [Tensor<Float>] may have an unknown number of elements at compile time.

This protocol can be derived automatically for structs whose stored properties all conform to the TensorGroup protocol. It cannot be derived automatically for structs whose properties all conform to TensorArrayProtocol due to the constructor requirement (i.e., in such cases it would be impossible to know how to break down count among the stored properties).

  • Declaration

    init(_owning tensorHandles: UnsafePointer<CTensorHandle>?, count: Int)
  • init(_handles:)

    Default implementation

    Default Implementation

    Declaration

    init<C>(_handles: C) where C : RandomAccessCollection, C.Element : _AnyTensorHandle