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
, parseinputShapeArray
to channel, height and widthNote
rank of
inputShapeArray
should be3
.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 markerDeclaration
Swift
public func cblasTrans(_ mark: Bool) -> CBLAS_TRANSPOSE
-
Generate 6-length random string from
[a-zA-Z0-9]
Declaration
Swift
public func serranoSymbolUIDGenerate() -> String
Return Value
ID