nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/util/DataTypeUtil.java
public static int lengthForDtype(DataBuffer.Type type) {
        switch (type) {
            case DOUBLE:
                return 8;
            case FLOAT:
                return 4;
            case INT:
                return 4;
            case HALF:
                return 2;
            case LONG:
                return 8;
            case COMPRESSED:
            default:
                throw new IllegalArgumentException("Illegal opType for length");

        }


    }
public static int lengthForDtype(DataBuffer.Type type) {
        switch (type) {
            case DOUBLE:
                return 8;
            case FLOAT:
                return 4;
            case INT:
                return 4;
            case HALF:
                return 2;
            case LONG:
                return 8;
            case COMPRESSED:
            default:
                throw new IllegalArgumentException("Illegal opType for length");

        }


    }
public static int lengthForDtype ( DataBuffer . Type type ) { switch ( type ) { case DOUBLE : return 8 ; case FLOAT : return 4 ; case INT : return 4 ; case HALF : return 2 ; case LONG : return 8 ; case COMPRESSED : default : throw new IllegalArgumentException ( "Illegal opType for length" ) ; } }
Returns the length for the given data opType
@param type
@return
Returns the length for the given data opType