Functions

The following functions are available globally.

  • Caculate output size for convolutiona like kernel scanning operation.

    Valid

    Int(Float((inputSize - stride + 1) / patchSize).rounded(.up))

    Same

    Int(Float(inputSize / stride).rounded(.up))

    Declaration

    Swift

    public func kernelScanningOutSize(_ mode: PaddingMode, inputSize: Int, kernelSize: Int, stride: Int) -> Int

    Parameters

    mode

    mode

    inputSize

    inputSize description

    kernelSize

    kernel size

    stride

    stride

    Return Value

    return value

  • According to channelOrder, parse inputShapeArray to channel, height and width

    Note

    rank of inputShapeArray should be 3.

    Declaration

    Swift

    public func parseImgChannelShapeInfo(_ channelOrder: TensorChannelOrder, shapeArray: [Int]) -> (channel:Int, height:Int, width: Int)

    Parameters

    channelOrder

    channelOrder

    shapeArray

    inputShapeArray

    Return Value

    return value

  • Get CBLAS_TRANSPOSE enum value from Bool marker

    Declaration

    Swift

    public func cblasTrans(_ mark: Bool) -> CBLAS_TRANSPOSE