nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
@Override
    public IComplexNDArray complexScalar(Number value, long offset) {
        if (Nd4j.dataType() == DataBuffer.Type.DOUBLE)
            return scalar(createDouble(value.doubleValue(), 0), offset);
        if (Nd4j.dataType() == DataBuffer.Type.FLOAT || Nd4j.dataType() == DataBuffer.Type.INT
                        || Nd4j.dataType() == DataBuffer.Type.HALF)
            return scalar(createFloat(value.floatValue(), 0), offset);

        throw new IllegalStateException("Illegal data opType " + Nd4j.dataType());
    }
@Override
    public IComplexNDArray complexScalar(Number value, long offset) {
        if (Nd4j.dataType() == DataBuffer.Type.DOUBLE)
            return scalar(createDouble(value.doubleValue(), 0), offset);
        if (Nd4j.dataType() == DataBuffer.Type.FLOAT || Nd4j.dataType() == DataBuffer.Type.INT
                        || Nd4j.dataType() == DataBuffer.Type.HALF)
            return scalar(createFloat(value.floatValue(), 0), offset);

        throw new IllegalStateException("Illegal data opType " + Nd4j.dataType());
    }
Create a scalar ndarray with the specified offset

@param value  the value to initialize the scalar with
@param offset the offset of the ndarray
@return the created ndarray