Class FlatBuffersMapper


  • public class FlatBuffersMapper
    extends Object
    • Method Detail

      • getLossReduceFromByte

        public static LossReduce getLossReduceFromByte​(byte input)
        Convert the input byte to the equivalent LossReduce, will throw an IllegalArgumentException if the value is not found
        Parameters:
        input - the special input
        Returns:
        the equivalent LossReduce value if one is found
      • getLossFunctionAsByte

        public static byte getLossFunctionAsByte​(@NonNull
                                                 @NonNull LossReduce lossReduce)
        Convert the LossReduce enum to its flatbuffers equivalent bytes.
        Parameters:
        lossReduce - the loss reduce input
        Returns:
      • getDataTypeAsByte

        public static byte getDataTypeAsByte​(@NonNull
                                             @NonNull DataType type)
        This method converts enums for DataType
      • getDataTypeFromByte

        public static DataType getDataTypeFromByte​(byte val)
        This method converts enums for DataType
      • getOpNum

        public static long getOpNum​(String name,
                                    Op.Type type)
        This method return operation ID for given op name/type pair.
      • getTypeFromByte

        public static Op.Type getTypeFromByte​(byte type)
        This method converts enums for Op.Type
        Parameters:
        type - Byte representing the op type
        Returns:
        Op type
      • getFlatOpType

        public static byte getFlatOpType​(Op.Type type)
        This method converts an Op.Type to it's corresponding byte value
        Parameters:
        type - type to convert
        Returns:
        Byte representing the op type
      • getOrderFromByte

        public static ByteOrder getOrderFromByte​(byte val)
        This method just converts enums
      • getOrderAsByte

        public static byte getOrderAsByte()
        This method returns current byte order for this JVM as libnd4j enum
      • mapFunctionPropertiesToFlatProperties

        public static int[] mapFunctionPropertiesToFlatProperties​(com.google.flatbuffers.FlatBufferBuilder fbb,
                                                                  Map<String,​Object> fnProps)
      • mapOrNull

        public static int[] mapOrNull​(List<String> list,
                                      com.google.flatbuffers.FlatBufferBuilder fbb)
      • toVarType

        public static byte toVarType​(VariableType variableType)
      • fromVarType

        public static VariableType fromVarType​(byte varType)