Return a variable of given shape in which all values have a given constant value.

@param value constant to set for each value
@param shape shape of the variable as long array
@return A new SDVariable of provided shape with constant value.
341001
@Deprecated
    public SDVariable constant(SDVariable value, long... shape) {
        return constant(null, value, shape);
    }
88765
@Nonnull
  public PreprocessorContext setGlobalVariable(@Nonnull final String name, @Nonnull final Value value) {
    assertNotNull("Variable name is null", name);

    final String normalizedName = assertNotNull(PreprocessorUtils.normalizeVariableName(name));

    if (normalizedName.isEmpty()) {
      throw makeException("Name is empty", null);
    }

    assertNotNull("Value is null", value);

    if (mapVariableNameToSpecialVarProcessor.containsKey(normalizedName)) {
      mapVariableNameToSpecialVarProcessor.get(normalizedName).setVariable(normalizedName, value, this);
    } else {
      if (isVerbose()) {
        final String valueAsStr = value.toString();
        if (globalVarTable.containsKey(normalizedName)) {
          logForVerbose("Replacing global variable [" + normalizedName + '=' + valueAsStr + ']');
        } else {
          logForVerbose("Defining new global variable [" + normalizedName + '=' + valueAsStr + ']');
        }
      }
      globalVarTable.put(normalizedName, value);
    }
    return this;
  }
1269324
public static Expression constant(final double value) {
    return new Expression(Type.DOUBLE_TYPE, Feature.CHEAP) {
      @Override
      protected void doGen(CodeBuilder mv) {
        mv.pushDouble(value);
      }
    };
  }
8361
public static INDArrayIndex[] indexesFor(long... shape) {
        INDArrayIndex[] ret = new INDArrayIndex[shape.length];
        for (int i = 0; i < shape.length; i++) {
            ret[i] = NDArrayIndex.point(shape[i]);
        }

        return ret;
    }
363192
public SDVariable assign(SDVariable x, SDVariable y) {
        return assign(null, x, y);
    }
985849
public SDVariable dot(SDVariable x, SDVariable y, int... dimensions) {
        return dot(null, x, y, dimensions);
    }
914404
public static MutableDataPoint fromPoint(final DataPoint value) {
    if (value.isInteger()) return ofLongValue(value.timestamp(), value.longValue());
    else return ofDoubleValue(value.timestamp(), value.doubleValue());
  }
414702
public Shape getShape (String shape_id) {
        Shape shape = new Shape(this, shape_id);
        return shape.shape_dist_traveled.length > 0 ? shape : null;
    }
222063
@Override
    public INDArray create(List<INDArray> list, int[] shape) {
        if (order == FORTRAN)
            return new JCublasNDArray(list, shape, ArrayUtil.calcStridesFortran(shape));
        else
            return new JCublasNDArray(list, shape);
    }
157337
public SDVariable pad(SDVariable input, int[][] padding, double constant){
        return pad(input, sd.constant(Nd4j.createFromArray(padding)), constant);
    }
148421
public PropertyFilter<S> constant(Object value) {
        if (mBindID == BOUND_CONSTANT) {
            if (mConstant == null) {
                if (value == null) {
                    return this;
                }
            } else if (mConstant.equals(value)) {
                return this;
            }
        }
        return getCanonical(mProperty, mOp, adaptValue(value));
    }
1280773
public SDVariable fill(SDVariable shape, org.nd4j.linalg.api.buffer.DataType dataType, double value) {
        return fill(null, shape, dataType, value);
    }
123593
@SuppressWarnings("unchecked")
    static <T> Node<T> emptyNode(StreamShape shape) {
        switch (shape) {
            case REFERENCE:    return (Node<T>) EMPTY_NODE;
            case INT_VALUE:    return (Node<T>) EMPTY_INT_NODE;
            case LONG_VALUE:   return (Node<T>) EMPTY_LONG_NODE;
            case DOUBLE_VALUE: return (Node<T>) EMPTY_DOUBLE_NODE;
            default:
                throw new IllegalStateException("Unknown shape " + shape);
        }
    }
1180112
public void setFormValue(Object value) {

        if (value == null) {
            value = "";
        }
        if (value instanceof String) {
            String strValue = (String)value;
            if (strValue.length() > 0) {
                checkvalue(strValue);
            }
        }

    }
298581
public SDVariable constant(String name, float value) {
        try(MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
            return constant(name, Nd4j.scalar(value));
        }
    }
773549
public SDVariable squaredNorm(SDVariable x, boolean keepDims, int... dimensions) {
        return squaredNorm(null, x, keepDims, dimensions);
    }
432043
public SDVariable addVariable(SDVariable variable) {
        Preconditions.checkState(variable.getSameDiff() == this, "Samediff instance must be the same.");

        if (variables.containsKey(variable.getVarName()) && !variables.get(variable.getVarName()).getVariable().equals(variable)) {
            throw new IllegalArgumentException("Variable already found with variable opName " + variable.getVarName());
        }

        Preconditions.checkState(variable.getSameDiff() == this, "Same diff instance for variable must be the same!");
        variables.put(variable.getVarName(), Variable.builder().name(variable.getVarName()).variable(variable).build());
        return variable;
    }