Enumerations

The following enumerations are available globally.

  • Padding mode for operators involving with kernel calculation, like pooling and convolution operators. We follow same behavior as TensorFlow defined.

    Valid padding

    No padding at all when moving kernel on input tensor.

    Same padding

    Padding to cover all elements

    See more

    Declaration

    Swift

    public enum PaddingMode: Int
  • The channel order in a N-D tensor.

    First

    Coming before tensor shape. For example an image with height H and width W, it will be represented as [C, H, W]

    Last

    Coming after tensor shape. For example an image with height H and width W, it will be represented as [C, H, W]

    See more

    Declaration

    Swift

    public enum TensorChannelOrder: Int
  • Two kernels

    • Single: Caclulate a single element each thread
    • SubMatrix: Caculate a submatrix each thread
    See more

    Declaration

    Swift

    public enum MatrixMultKernel
  • Defined the supported data type stored in Tensor object.

    Should be matching with supported scalar data types in Apple’s Metal specification (section 2.1)

    Currently compatible with v1.2 with types:

    • int32: A signed two’s complement 32-bit integer
    • uint32: An unsigned 32-bit integer
    • float16: A 16-bit floating-point
    • float32: A 32-bit floating-point
    See more

    Declaration

    Swift

    public enum TensorDataType