nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
public SDVariable var(String name, long[] shape, WeightInitScheme weightInitScheme) {
        if (variableMap.containsKey(name) && variableMap.get(name).getArr() != null)
            return variableMap.get(name);


        if (name == null || name.length() < 1)
            throw new IllegalArgumentException("Name for variable must be defined");

        if (workspace == null)
            initWorkspace();


        SDVariable ret = SDVariable.builder()
                .sameDiff(this)
                .shape(shape).weightInitScheme(weightInitScheme)
                .varName(name)
                .build();


        addVariable(ret);
        variableMap.put(name, ret);
        return ret;

    }
public SDVariable var(String name, long[] shape, WeightInitScheme weightInitScheme) {
        if (variableMap.containsKey(name) && variableMap.get(name).getArr() != null)
            return variableMap.get(name);


        if (name == null || name.length() < 1)
            throw new IllegalArgumentException("Name for variable must be defined");

        if (workspace == null)
            initWorkspace();


        SDVariable ret = SDVariable.builder()
                .sameDiff(this)
                .shape(shape).weightInitScheme(weightInitScheme)
                .varName(name)
                .build();


        addVariable(ret);
        variableMap.put(name, ret);
        return ret;

    }
public SDVariable var ( String name , long [ ] shape , WeightInitScheme weightInitScheme ) { if ( variableMap . containsKey ( name ) && variableMap . get ( name ) . getArr ( ) != null ) return variableMap . get ( name ) ; if ( name == null || name . length ( ) < 1 ) throw new IllegalArgumentException ( "Name for variable must be defined" ) ; if ( workspace == null ) initWorkspace ( ) ; SDVariable ret = SDVariable . builder ( ) . sameDiff ( this ) . shape ( shape ) . weightInitScheme ( weightInitScheme ) . varName ( name ) . build ( ) ; addVariable ( ret ) ; variableMap . put ( name , ret ) ; return ret ; }
Variable initialization
with a specified {@link WeightInitScheme}

@param name             the opName of the variable
@param shape            the shape of the array to be created
@param weightInitScheme the weight init scheme
@return the created variable
Variable initialization with a specified { @link WeightInitScheme }