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 }
-
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 }
-
Declaration
Swift
subscript(i0: Int, range: Range<Int>, streamContext streamContext: StreamContext?) -> Self { get set }
-
Declaration
Swift
subscript(i0: Int, i1: Int, range: Range<Int>, streamContext streamContext: StreamContext?) -> Self
-
Declaration
Swift
subscript( i0: Int, i1: Int, i2: Int, range: Range<Int>, streamContext streamContext: StreamContext? ) -> Self
-
Declaration
Swift
subscript( i0: Int, i1: Int, i2: Int, i3: Int, range: Range<Int>, streamContext streamContext: StreamContext? ) -> Self
-
Declaration
Swift
subscript( i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, range: Range<Int>, streamContext streamContext: StreamContext? ) -> Self
-
Declaration
Swift
subscript( i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, range: Range<Int>, streamContext streamContext: StreamContext? ) -> Self
-
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
-
Transpose from axisA to axisB.
Declaration
Swift
func transposed(_ axisA: Int, _ axisB: Int, streamContext: StreamContext?) -> Self
-
Fill the given tensor with uniform random values.
Declaration
Swift
func rand(_ range: ClosedRange<Float>, streamContext: StreamContext?)
-
Fill the given tensor with normal-distributed random values.
Declaration
Swift
func randn(std: Float, mean: Float, streamContext: StreamContext?)
-
Copy the given tensor to GPU.
Declaration
Swift
func toGPU(_ ordinal: Int, streamContext: StreamContext?) -> Self
-
Copy the given tensor to CPU.
Declaration
Swift
func toCPU(streamContext: StreamContext?) -> Self
-
Fill the given tensor with a value.
Declaration
Swift
func full(_ value: Float, streamContext: StreamContext?)
-
Interpolate from this tensor to the other tensor.
Declaration
Swift
func lerp(_ weight: Float, to: Self, streamContext: StreamContext?)
-
Clamp the given tensor between two values.
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()
-
Clamp the given tensor between two values.
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
-
Make a copy of the given tensor.
Declaration
Swift
func copied(streamContext: StreamContext?) -> Self
-
Only ake a copy of the given tensor if it is not contiguous in memory.
Declaration
Swift
func contiguous(streamContext: StreamContext?) -> Self
-
Reduce along a given dimension.
Declaration
Swift
func reduced(_ op: ReduceOp, axis: [Int], streamContext: StreamContext?) -> Self
-
Scale the given tensor with a constant inplace.
Declaration
Swift
func scale(by a: Float, streamContext: StreamContext?)
-
Scale the given tensor with a constant.
Declaration
Swift
func scaled(by a: Float, streamContext: StreamContext?) -> Self
-
Apply softmax activation to the given tensor inplace.
Declaration
Swift
func softmax(streamContext: StreamContext?)
-
Apply ReLU activation to the given tensor inplace.
Declaration
Swift
func ReLU(streamContext: StreamContext?)
-
Apply sigmoid activation to the given tensor inplace.
Declaration
Swift
func sigmoid(streamContext: StreamContext?)
-
Apply tanh activation to the given tensor inplace.
Declaration
Swift
func tanh(streamContext: StreamContext?)
-
Apply swish activation to the given tensor inplace.
Declaration
Swift
func swish(streamContext: StreamContext?)
-
Chunk the current tensor into multiple ones.
Declaration
Swift
func chunked(_ numberOfChunks: Int, axis: Int, streamContext: StreamContext?) -> [Self]
-
subscript(_:
Extension method) Declaration
Swift
@inlinable public subscript(ranges: Range<Int>...) -> Self { get set }
-
subscript(_:
Extension method) Declaration
Swift
@inlinable public subscript(ranges: [Range<Int>]) -> Self { get set }
-
subscript(_:
Extension method) Declaration
Swift
@inlinable public subscript(range: Range<Int>) -> Self { get set }
-
subscript(_:
Extension method_: ) Declaration
Swift
@inlinable public subscript(i0: Int, range: Range<Int>) -> Self
-
subscript(_:
Extension method_: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method_: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method_: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, i6: Int, range: Range<Int> ) -> Self
-
subscript(_:
Extension method) Declaration
Swift
@inlinable public subscript(range: UnboundedRange) -> Self { get set }
-
subscript(_:
Extension method_: ) Declaration
Swift
@inlinable public subscript(i0: Int, range: UnboundedRange) -> Self
-
subscript(_:
Extension method_: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, range: UnboundedRange ) -> Self
-
subscript(_:
Extension method_: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, range: UnboundedRange ) -> Self
-
subscript(_:
Extension method_: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, range: UnboundedRange ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, range: UnboundedRange ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, range: UnboundedRange ) -> Self
-
subscript(_:
Extension method_: _: _: _: _: _: _: ) Declaration
Swift
@inlinable public subscript(i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int, i6: Int, range: UnboundedRange ) -> Self
-
transposed(_:
Extension method_: ) Transpose from axisA to axisB.
Declaration
Swift
@inlinable public func transposed(_ axisA: Int, _ axisB: Int) -> Self
-
rand(_:
Extension method) Fill the given tensor with uniform random values.
Declaration
Swift
@inlinable public func rand(_ range: ClosedRange<Float> = 0...1)
-
randn(std:
Extension methodmean: ) Fill the given tensor with normal-distributed random values.
Declaration
Swift
@inlinable public func randn(std: Float = 1, mean: Float = 0)
-
toGPU(_:
Extension method) Copy the given tensor to GPU.
Declaration
Swift
@inlinable public func toGPU(_ ordinal: Int = 0) -> Self
-
toCPU()
Extension methodCopy the given tensor to CPU.
Declaration
Swift
@inlinable public func toCPU() -> Self
-
full(_:
Extension method) Fill the given tensor with a value.
Declaration
Swift
@inlinable public func full(_ value: Float = 0)
-
lerp(_:
Extension methodto: ) Interpolate from this tensor to the other tensor.
Declaration
Swift
@inlinable public func lerp(_ weight: Float, to: Self)
-
clamp(_:
Extension method) Clamp the given tensor between two values.
Declaration
Swift
@inlinable public func clamp(_ range: ClosedRange<Float>)
-
clamp(_:
Extension method) Clamp the given tensor with a lower bound.
Declaration
Swift
@inlinable public func clamp(_ range: PartialRangeFrom<Float>)
-
clamp(_:
Extension method) Clamp the given tensor with an upper bound.
Declaration
Swift
@inlinable public func clamp(_ range: PartialRangeThrough<Float>)
-
clamped(_:
Extension method) Clamp the given tensor between two values.
Declaration
Swift
@inlinable public func clamped(_ range: ClosedRange<Float>) -> Self
-
clamped(_:
Extension method) Clamp the given tensor with a lower bound.
Declaration
Swift
@inlinable public func clamped(_ range: PartialRangeFrom<Float>) -> Self
-
clamped(_:
Extension method) Clamp the given tensor with an upper bound.
Declaration
Swift
@inlinable public func clamped(_ range: PartialRangeThrough<Float>) -> Self
-
copied()
Extension methodMake a copy of the given tensor.
Declaration
Swift
@inlinable public func copied() -> Self
-
contiguous()
Extension methodOnly make a copy of the given tensor if it is not contiguous in memory.
Declaration
Swift
@inlinable public func contiguous() -> Self
-
reduced(_:
Extension methodaxis: ) Reduce along a given dimension.
Declaration
Swift
@inlinable public func reduced(_ op: ReduceOp, axis: [Int]) -> Self
-
scale(by:
Extension method) Scale the given tensor with a constant inplace.
Declaration
Swift
@inlinable public func scale(by a: Float)
-
scaled(by:
Extension method) Scale the given tensor with a constant.
Declaration
Swift
@inlinable public func scaled(by a: Float) -> Self
-
softmax()
Extension methodApply softmax activation to the given tensor inplace.
Declaration
Swift
@inlinable public func softmax()
-
ReLU()
Extension methodApply ReLU activation to the given tensor inplace.
Declaration
Swift
@inlinable public func ReLU()
-
sigmoid()
Extension methodApply sigmoid activation to the given tensor inplace.
Declaration
Swift
@inlinable public func sigmoid()
-
tanh()
Extension methodApply tanh activation to the given tensor inplace.
Declaration
Swift
@inlinable public func tanh()
-
swish()
Extension methodApply swish activation to the given tensor inplace.
Declaration
Swift
@inlinable public func swish()
-
chunked(_:
Extension methodaxis: ) Chunk the current tensor into multiple ones.
Declaration
Swift
@inlinable public func chunked(_ numberOfChunks: Int, axis: Int = 0) -> [Self]