DynamicGraph_TensorGroup

public protocol DynamicGraph_TensorGroup : DynamicGraph_AnyTensorGroup

Represent a type-checked parameters that encapsulate both tensor and group of tensors.

  • Declaration

    Swift

    associatedtype ElementNumeric : TensorNumeric
  • Declaration

    Swift

    init(_: AnyTensor)
  • Declaration

    Swift

    var grad: AnyTensor? { get set }
  • Declaration

    Swift

    var typeErased: AnyTensor { get }
  • Declaration

    Swift

    var isNaN: Bool { get }
  • subscript(_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(ranges: Range<Int>..., streamContext streamContext: StreamContext?) -> Self { get set }
  • Declaration

    Swift

    subscript(ranges: [Range<Int>], streamContext streamContext: StreamContext?) -> Self { get set }
  • Declaration

    Swift

    subscript(range: Range<Int>, streamContext streamContext: StreamContext?) -> Self { get set }
  • subscript(_:_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(i0: Int, range: Range<Int>, streamContext streamContext: StreamContext?) -> Self { get set }
  • subscript(_:_:_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(i0: Int, i1: Int, range: Range<Int>, streamContext streamContext: StreamContext?)
      -> Self
  • subscript(_:_:_:_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, range: Range<Int>, streamContext streamContext: StreamContext?
    ) -> Self
  • subscript(_:_:_:_:_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, range: Range<Int>,
      streamContext streamContext: StreamContext?
    ) -> Self
  • subscript(_:_:_:_:_:_:streamContext:) Default implementation

    Default Implementation

    Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, range: Range<Int>,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Default Implementation

    Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, range: Range<Int>,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Default Implementation

    Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, i6: Int, range: Range<Int>,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Declaration

    Swift

    subscript(range: UnboundedRange, streamContext streamContext: StreamContext?) -> Self { get set }
  • Declaration

    Swift

    subscript(i0: Int, range: UnboundedRange, streamContext streamContext: StreamContext?) -> Self { get set }
  • Declaration

    Swift

    subscript(i0: Int, i1: Int, range: UnboundedRange, streamContext streamContext: StreamContext?)
      -> Self
  • Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, range: UnboundedRange, streamContext streamContext: StreamContext?
    ) -> Self
  • Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, range: UnboundedRange,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, range: UnboundedRange,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, range: UnboundedRange,
      streamContext streamContext: StreamContext?
    ) -> Self
  • Declaration

    Swift

    subscript(
      i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, i6: Int, range: UnboundedRange,
      streamContext streamContext: StreamContext?
    ) -> Self
  • transposed(_:_:streamContext:) Default implementation

    Transpose from axisA to axisB.

    Default Implementation

    Transpose from axisA to axisB.

    Declaration

    Swift

    func transposed(_ axisA: Int, _ axisB: Int, streamContext: StreamContext?) -> Self
  • rand(_:streamContext:) Default implementation

    Fill the given tensor with uniform random values.

    Default Implementation

    Fill the given tensor with uniform random values.

    Declaration

    Swift

    func rand(_ range: ClosedRange<Float>, streamContext: StreamContext?)
  • randn(std:mean:streamContext:) Default implementation

    Fill the given tensor with normal-distributed random values.

    Default Implementation

    Fill the given tensor with normal-distributed random values.

    Declaration

    Swift

    func randn(std: Float, mean: Float, streamContext: StreamContext?)
  • toGPU(_:streamContext:) Default implementation

    Copy the given tensor to GPU.

    Default Implementation

    Copy the given tensor to GPU.

    Declaration

    Swift

    func toGPU(_ ordinal: Int, streamContext: StreamContext?) -> Self
  • toCPU(streamContext:) Default implementation

    Copy the given tensor to CPU.

    Default Implementation

    Copy the given tensor to CPU.

    Declaration

    Swift

    func toCPU(streamContext: StreamContext?) -> Self
  • full(_:streamContext:) Default implementation

    Fill the given tensor with a value.

    Default Implementation

    Fill the given tensor with a value.

    Declaration

    Swift

    func full(_ value: Float, streamContext: StreamContext?)
  • lerp(_:to:streamContext:) Default implementation

    Interpolate from this tensor to the other tensor.

    Default Implementation

    Interpolate from this tensor to the other tensor.

    Declaration

    Swift

    func lerp(_ weight: Float, to: Self, streamContext: StreamContext?)
  • clamp(_:streamContext:) Default implementation

    Clamp the given tensor between two values.

    Default Implementation

    Clamp the given tensor with an upper bound.

    Declaration

    Swift

    func clamp(_ range: ClosedRange<Float>, streamContext: StreamContext?)
  • Clamp the given tensor with a lower bound.

    Declaration

    Swift

    func clamp(_ range: PartialRangeFrom<Float>, streamContext: StreamContext?)
  • Clamp the given tensor with an upper bound.

    Declaration

    Swift

    func clamp(_ range: PartialRangeThrough<Float>, streamContext: StreamContext?)
  • Detach current tensor from the graph. Afterwards, it is always “isConstant” and cannot requiresGrad.

    Declaration

    Swift

    mutating func detach()
  • clamped(_:streamContext:) Default implementation

    Clamp the given tensor between two values.

    Default Implementation

    Clamp the given tensor with an upper bound.

    Declaration

    Swift

    func clamped(_ range: ClosedRange<Float>, streamContext: StreamContext?) -> Self
  • Clamp the given tensor with a lower bound.

    Declaration

    Swift

    func clamped(_ range: PartialRangeFrom<Float>, streamContext: StreamContext?) -> Self
  • Clamp the given tensor with an upper bound.

    Declaration

    Swift

    func clamped(_ range: PartialRangeThrough<Float>, streamContext: StreamContext?) -> Self
  • copied(streamContext:) Default implementation

    Make a copy of the given tensor.

    Default Implementation

    Make a copy of the given tensor.

    Declaration

    Swift

    func copied(streamContext: StreamContext?) -> Self
  • contiguous(streamContext:) Default implementation

    Only ake a copy of the given tensor if it is not contiguous in memory.

    Default Implementation

    Only make a copy of the given tensor if it is not contiguous in memory.

    Declaration

    Swift

    func contiguous(streamContext: StreamContext?) -> Self
  • reduced(_:axis:streamContext:) Default implementation

    Reduce along a given dimension.

    Default Implementation

    Reduce along a given dimension.

    Declaration

    Swift

    func reduced(_ op: ReduceOp, axis: [Int], streamContext: StreamContext?) -> Self
  • scale(by:streamContext:) Default implementation

    Scale the given tensor with a constant inplace.

    Default Implementation

    Scale the given tensor with a constant inplace.

    Declaration

    Swift

    func scale(by a: Float, streamContext: StreamContext?)
  • scaled(by:streamContext:) Default implementation

    Scale the given tensor with a constant.

    Default Implementation

    Scale the given tensor with a constant.

    Declaration

    Swift

    func scaled(by a: Float, streamContext: StreamContext?) -> Self
  • softmax(streamContext:) Default implementation

    Apply softmax activation to the given tensor inplace.

    Default Implementation

    Apply softmax activation to the given tensor inplace.

    Declaration

    Swift

    func softmax(streamContext: StreamContext?)
  • ReLU(streamContext:) Default implementation

    Apply ReLU activation to the given tensor inplace.

    Default Implementation

    Apply ReLU activation to the given tensor inplace.

    Declaration

    Swift

    func ReLU(streamContext: StreamContext?)
  • sigmoid(streamContext:) Default implementation

    Apply sigmoid activation to the given tensor inplace.

    Default Implementation

    Apply sigmoid activation to the given tensor inplace.

    Declaration

    Swift

    func sigmoid(streamContext: StreamContext?)
  • tanh(streamContext:) Default implementation

    Apply tanh activation to the given tensor inplace.

    Default Implementation

    Apply tanh activation to the given tensor inplace.

    Declaration

    Swift

    func tanh(streamContext: StreamContext?)
  • swish(streamContext:) Default implementation

    Apply swish activation to the given tensor inplace.

    Default Implementation

    Apply swish activation to the given tensor inplace.

    Declaration

    Swift

    func swish(streamContext: StreamContext?)
  • chunked(_:axis:streamContext:) Default implementation

    Chunk the current tensor into multiple ones.

    Default Implementation

    Chunk the current tensor into multiple ones.

    Declaration

    Swift

    func chunked(_ numberOfChunks: Int, axis: Int, streamContext: StreamContext?) -> [Self]