Functional
public enum Functional
-
Element-wise addition
Declaration
Swift
public static func sum<T: DynamicGraph.TensorGroup>( _ inputs: [T], streamContext: StreamContext? = nil ) -> T
-
Element-wise addition
Declaration
Swift
public static func sum<T: DynamicGraph.TensorGroup>( _ inputs: T..., streamContext: StreamContext? = nil ) -> T
-
Broadcast element-wise multiplication
Declaration
Swift
public static func mul<T: DynamicGraph.TensorGroup>( left: T, right: T, scalar: Float32 = 1, streamContext: StreamContext? = nil ) -> T
-
Broadcast element-wise addition
Declaration
Swift
public static func add<T: DynamicGraph.TensorGroup>( left: T, right: T, leftScalar: Float32 = 1, rightScalar: Float32 = 1, streamContext: StreamContext? = nil ) -> T
-
Element-wise division
Declaration
Swift
public static func div<T: DynamicGraph.TensorGroup>( left: T, right: T, streamContext: StreamContext? = nil ) -> T
-
Element-wise reciprocal
Declaration
Swift
public static func reciprocal<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Element-wise log
Declaration
Swift
public static func log<T: DynamicGraph.TensorGroup>(_ one: T, streamContext: StreamContext? = nil) -> T
-
Element-wise exp
Declaration
Swift
public static func exp<T: DynamicGraph.TensorGroup>(_ one: T, streamContext: StreamContext? = nil) -> T
-
Element-wise square root.
Declaration
Swift
public static func squareRoot<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Softmax activation
Declaration
Swift
public static func softmax<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
ReLU activation
Declaration
Swift
public static func ReLU<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Sigmoid activation
Declaration
Swift
public static func sigmoid<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Tanh activation
Declaration
Swift
public static func tanh<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Swish activation
Declaration
Swift
public static func swish<T: DynamicGraph.TensorGroup>( _ one: T, streamContext: StreamContext? = nil ) -> T
-
Average pool
Declaration
Swift
public static func averagePool<T: DynamicGraph.TensorGroup>( _ one: T, filterSize: [Int], hint: Hint = Hint(), streamContext: StreamContext? = nil ) -> T
-
Max pool
Declaration
Swift
public static func maxPool<T: DynamicGraph.TensorGroup>( _ one: T, filterSize: [Int], hint: Hint = Hint(), streamContext: StreamContext? = nil ) -> T
-
Argmax
Declaration
Swift
public static func argmax( _ one: DynamicGraph.AnyTensor, axis: Int, streamContext: StreamContext? = nil ) -> DynamicGraph.Tensor<Int32>
-
Argmax
Declaration
Swift
public static func argmax( _ one: DynamicGraph.Group<DynamicGraph.AnyTensor>, axis: Int, streamContext: StreamContext? = nil ) -> DynamicGraph.Group<DynamicGraph.Tensor<Int32>>
-
Argmin
Declaration
Swift
public static func argmin( _ one: DynamicGraph.AnyTensor, axis: Int, streamContext: StreamContext? = nil ) -> DynamicGraph.Tensor<Int32>
-
Argmax
Declaration
Swift
public static func argmin( _ one: DynamicGraph.Group<DynamicGraph.AnyTensor>, axis: Int, streamContext: StreamContext? = nil ) -> DynamicGraph.Group<DynamicGraph.Tensor<Int32>>
-
Matrix multiplication
Declaration
Swift
public static func matmul<T: DynamicGraph.TensorGroup>( left: T, right: T, leftTranspose: (Int, Int) = (0, 0), rightTranspose: (Int, Int) = (0, 0), streamContext: StreamContext? = nil ) -> T
-
Scalar-matrix multiplication.
Declaration
Swift
public static func scalmul<T: DynamicGraph.TensorGroup>( left: Float, right: T, streamContext: StreamContext? = nil ) -> T
-
Complex number multiplication
Declaration
Swift
public static func cmul<T: DynamicGraph.TensorGroup>( left: T, right: T, streamContext: StreamContext? = nil ) -> T
-
Make a copy.
Declaration
Swift
public static func copy<T: DynamicGraph.TensorGroup>( from: T, to: T, streamContext: StreamContext? = nil )
-
Select input tensor with another index tensor.
Declaration
Swift
public static func indexSelect<T: DynamicGraph.TensorGroup, U: DynamicGraph.TensorGroup>( input: T, index: U, streamContext: StreamContext? = nil ) -> T where U.ElementNumeric == Int32, T.AnyTensor == U.AnyTensor
-
Select input tensor with another index tensor.
Declaration
Swift
public static func indexSelect<T: DynamicGraph.TensorGroup, U: DynamicGraph.TensorGroup>( input: T, index: U, streamContext: StreamContext? = nil ) -> T where U.ElementNumeric == Float32, T.AnyTensor == U.AnyTensor
-
Masked fill a tensor based on other tensor’s content equal to another.
Declaration
Swift
public static func maskedFill<T: DynamicGraph.TensorGroup, U: DynamicGraph.TensorGroup>( input: T, mask: U, equalTo: Float, fillWith: Float, streamContext: StreamContext? = nil ) -> T where T.AnyTensor == U.AnyTensor
-
Element-wise min for two input tensors
Declaration
Swift
public static func min<T: DynamicGraph.TensorGroup>( _ left: T, _ right: T, streamContext: StreamContext? = nil ) -> T
-
Element-wise max for two input tensors
Declaration
Swift
public static func max<T: DynamicGraph.TensorGroup>( _ left: T, _ right: T, streamContext: StreamContext? = nil ) -> T
-
Declaration
Swift
public static func mul(left: ModelIOConvertible, right: ModelIOConvertible, scalar: Float) -> Model.IO
-
Declaration
Swift
public static func matmul( left: ModelIOConvertible, right: ModelIOConvertible, leftTranspose: (Int, Int), rightTranspose: (Int, Int) ) -> Model.IO
-
Declaration
Swift
public static func cmul(left: ModelIOConvertible, right: ModelIOConvertible) -> Model.IO
-
Declaration
Swift
public static func min(_ left: ModelIOConvertible, _ right: ModelIOConvertible) -> Model.IO
-
Declaration
Swift
public static func max(_ left: ModelIOConvertible, _ right: ModelIOConvertible) -> Model.IO
-
Declaration
Swift
public static func concat(axis: Int, _ inputs: ModelIOConvertible...) -> Model.IO
-
Declaration
Swift
public static func concat<T: DynamicGraph.TensorGroup>( axis: Int, _ inputs: T..., streamContext: StreamContext? = nil ) -> T