IO

public class IO

A IO class represent the abstract input / output for a model. It can correspond to one or more tensors when the model is materialized.

  • Reshape an IO to a new dimension. You cannot reshape data types.

    Declaration

    Swift

    public func reshaped(_ dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil)
      -> Model.IO

    Parameters

    dimensions

    The new dimensions for the input.

    offset

    Whether apply certain offset for each dimension.

    increments

    What’s the step size for each dimension.

  • Apply ReLU activation to the said IO.

    Declaration

    Swift

    public func ReLU() -> Model.IO
  • Apply softmax activation to the said IO.

    Declaration

    Swift

    public func softmax() -> Model.IO
  • Apply sigmoid activation to the said IO.

    Declaration

    Swift

    public func sigmoid() -> Model.IO
  • Apply tanh activation to the said IO.

    Declaration

    Swift

    public func tanh() -> Model.IO
  • Apply swish activation to the said IO.

    Declaration

    Swift

    public func swish() -> Model.IO
  • Declaration

    Swift

    public func transposed(_ axisA: Int, _ axisB: Int) -> Model.IO
  • Declaration

    Swift

    public func reduced(_ op: ReduceOp, axis: [Int]) -> Model.IO