nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
public void updateShapeForVarName(String varName, long[] shape) {
        if (shape == null) {
            throw new ND4JIllegalStateException("Null shapes not allowed!");
        }

        if (variableNameToArr.containsKey(varName) && !Arrays.equals(variableNameToArr.get(varName).shape(), shape)) {
            throw new ND4JIllegalStateException("Already found an existing array!");
        }


        for (int i = 0; i < shape.length; i++) {
            if (shape[i] < 1) {
                addAsPlaceHolder(varName);
                placeHolderOriginalShapes.put(varName, shape);
                return;
            }
        }


        variableNameToShape.put(varName, shape);
    }
public void updateShapeForVarName(String varName, long[] shape) {
        if (shape == null) {
            throw new ND4JIllegalStateException("Null shapes not allowed!");
        }

        if (variableNameToArr.containsKey(varName) && !Arrays.equals(variableNameToArr.get(varName).shape(), shape)) {
            throw new ND4JIllegalStateException("Already found an existing array!");
        }


        for (int i = 0; i < shape.length; i++) {
            if (shape[i] < 1) {
                addAsPlaceHolder(varName);
                placeHolderOriginalShapes.put(varName, shape);
                return;
            }
        }


        variableNameToShape.put(varName, shape);
    }
Update a vertex id with the given shape.
Note that you should use {@link #putShapeForVarName(String, int[])}
if you want to add a new shape.
Update is meant to be an in place replacement
of the shape for the vertex id *only*.

@param varName the vertex id to associate
@param shape   the shape to associate with