nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/util/AllocUtil.java
public static DataBuffer.AllocationMode getAllocationModeFromContext(String allocMode) {
        switch (allocMode) {
            case "heap":
                return DataBuffer.AllocationMode.HEAP;
            case "javacpp":
                return DataBuffer.AllocationMode.JAVACPP;
            case "direct":
                return DataBuffer.AllocationMode.DIRECT;
            default:
                return DataBuffer.AllocationMode.JAVACPP;
        }
    }
public static DataBuffer.AllocationMode getAllocationModeFromContext(String allocMode) {
        switch (allocMode) {
            case "heap":
                return DataBuffer.AllocationMode.HEAP;
            case "javacpp":
                return DataBuffer.AllocationMode.JAVACPP;
            case "direct":
                return DataBuffer.AllocationMode.DIRECT;
            default:
                return DataBuffer.AllocationMode.JAVACPP;
        }
    }
Get the allocation mode from the context
@return