/** * Whether an op call is in place or not. * * @param reallyCall * @return */ public DynamicCustomOpsBuilder callInplace(boolean reallyCall) { if (reallyCall && !inplaceAllowed) throw new ND4JIllegalStateException("Requested op can't be called inplace"); this.inplaceCall = reallyCall; return this; }
@Override public IComplexNDArray divi(IComplexNumber n) { //return divi(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
public ExpandDims(SameDiff sameDiff, SDVariable[] args, int axis) { super(null, sameDiff, args); if (axis == Integer.MAX_VALUE) { throw new ND4JIllegalArgumentException("Cannot perform ExpandDims with axis == Integer.MAX_VALUE"); } this.axis = axis; addIArgument(this.axis); }
public static int rankFromShape(long[] shape){ if(shape == null){ throw new ND4JIllegalStateException("Cannot get rank from null shape array"); } return shape.length; }
@Override public IComplexNDArray rsubi(IComplexNumber n) { //return rsubi(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
@Override public List<SDVariable> doDiff(List<SDVariable> f1) { throw new ND4JIllegalStateException("Unable to differentiate a variable! Must be a function."); }
@Override public IComplexNDArray muli(IComplexNumber n) { //return muli(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
/** * Return the rank for the given shape * * @param shape Shape to get the rank for * @return Rank, of the array given the shape * @throws ND4JIllegalStateException If shape array is null */ public static int rankFromShape(int[] shape){ if(shape == null){ throw new ND4JIllegalStateException("Cannot get rank from null shape array"); } return shape.length; }
@Override public IComplexNDArray subi(IComplexNumber n) { //return subi(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
public static void checkShapeValues(int[] shape) { for (int e: shape) { if (e < 1) throw new ND4JIllegalStateException("Invalid shape: Requested INDArray shape " + Arrays.toString(shape) + " contains dimension size values < 1 (all dimensions must be 1 or more)"); } }
protected IComplexNDArray create(long[] shape) { //return Nd4j.createComplex(shape, Nd4j.getComplexStrides(shape, ordering()), 0); throw new ND4JComplexNumbersNotSupportedException(); }
/** * Get the function by the {@link DifferentialFunction#getOwnName()} * * @param id the id of the function * @return the function for the given id if it exists */ public DifferentialFunction getFunctionById(String id) { if (!functionInstancesById.containsKey(id)) { throw new ND4JIllegalStateException("No function with id " + id + " found!"); } return functionInstancesById.get(id); }
/** * Returns the element at the specified row/column * This will throw an exception if the * * @param row the row of the element to return * @param column the row of the element to return * @return a scalar indarray of the element at this index */ @Override public IComplexNDArray getScalar(long row, long column) { //return getScalar(new long[] {row, column}); throw new ND4JComplexNumbersNotSupportedException(); }
/** * Create a complex array from the given numbers * @param iComplexNumbers the numbers to use * @return the complex numbers */ public static IComplexNDArray createComplex(IComplexNumber[] iComplexNumbers) { if (iComplexNumbers == null || iComplexNumbers.length < 1) throw new ND4JIllegalStateException("Number of complex numbers can't be < 1 for new INDArray"); return createComplex(iComplexNumbers, new int[] {1, iComplexNumbers.length}); }
@Override public IComplexNDArray rdivi(IComplexNumber n) { //return rdivi(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
@Override public void assertValidForExecution() { if(numInputArguments() != 1 && numInputArguments() != 3 && numInputArguments() != 4) { throw new ND4JIllegalStateException("Num input arguments must be 1 3 or 4."); } if(numIArguments() < 5) { throw new ND4JIllegalStateException("Number of integer arguments must >= 5"); } }
@Override public IComplexNDArray addi(IComplexNumber n) { //return addi(n, Nd4j.createComplex(shape())); throw new ND4JComplexNumbersNotSupportedException(); }
/** * The left argument for this function * @return */ public SDVariable larg() { val args = args(); if(args == null || args.length == 0) throw new ND4JIllegalStateException("No arguments found."); return args()[0]; }
public static IComplexNDArray createComplex(long... shape) { //return createComplex(shape, order()); throw new ND4JComplexNumbersNotSupportedException(); }
@Override public IComplexNDArray putScalar(int i, IComplexNumber value) { long[] dimensions = Shape.ind2sub(this, i); //return putScalar(dimensions, value); throw new ND4JComplexNumbersNotSupportedException(); }