nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java
public static DataBuffer.Type typeFromTensorType(byte type,int elementSize) {
        if(type == Type.Decimal || type == Type.FloatingPoint) {
            if(elementSize == 4) {
                return DataBuffer.Type.FLOAT;
            }
            else if(elementSize == 8) {
                return DataBuffer.Type.DOUBLE;
            }
        }
        else if(type == Type.Int) {
            if(elementSize == 4) {
                return DataBuffer.Type.INT;
            }
            else if(elementSize == 8) {
                return DataBuffer.Type.LONG;
            }
        }
        else {
            throw new IllegalArgumentException("Only valid types are Type.Decimal and Type.Int");
        }

        throw new IllegalArgumentException("Unable to determine data type");
    }
public static DataBuffer.Type typeFromTensorType(byte type,int elementSize) {
        if(type == Type.Decimal || type == Type.FloatingPoint) {
            if(elementSize == 4) {
                return DataBuffer.Type.FLOAT;
            }
            else if(elementSize == 8) {
                return DataBuffer.Type.DOUBLE;
            }
        }
        else if(type == Type.Int) {
            if(elementSize == 4) {
                return DataBuffer.Type.INT;
            }
            else if(elementSize == 8) {
                return DataBuffer.Type.LONG;
            }
        }
        else {
            throw new IllegalArgumentException("Only valid types are Type.Decimal and Type.Int");
        }

        throw new IllegalArgumentException("Unable to determine data type");
    }
public static DataBuffer . Type typeFromTensorType ( byte type , int elementSize ) { if ( type == Type . Decimal || type == Type . FloatingPoint ) { if ( elementSize == 4 ) { return DataBuffer . Type . FLOAT ; } else if ( elementSize == 8 ) { return DataBuffer . Type . DOUBLE ; } } else if ( type == Type . Int ) { if ( elementSize == 4 ) { return DataBuffer . Type . INT ; } else if ( elementSize == 8 ) { return DataBuffer . Type . LONG ; } } else { throw new IllegalArgumentException ( "Only valid types are Type.Decimal and Type.Int" ) ; } throw new IllegalArgumentException ( "Unable to determine data type" ) ; }
Create thee databuffer type frm the given type,
relative to the bytes in arrow in class:
{@link Type}
@param type the type to create the nd4j {@link DataBuffer.Type} from
@param elementSize the element size
@return the data buffer type
Create thee databuffer type frm the given type relative to the bytes in arrow in class : {