@Test void testErrorSetTensor1() { Tensor tensor = new Tensor(DataType.INTEGER, new int[] {3, 2, 4}); EvaluationException exception = assertThrows( EvaluationException.class, () -> tensor.setOnCoord(4, 0, 0, -1) ); assertEquals("Coordinates contained at least an undefined value : [0, 0, -1]", exception.getMessage()); }
public void setOnCoord(Object value, int... coords) { checkCoordsLength(coords); if (value != null) { if (this.isScalar()) { this.data = value; } else if (value.getClass().isArray()) { this.setArrayOnCoord(value, coords); } else { this.setSingleOnCoord(value, coords); } } }
Tensor { public void setOnCoord(Object value, int... coords) { checkCoordsLength(coords); if (value != null) { if (this.isScalar()) { this.data = value; } else if (value.getClass().isArray()) { this.setArrayOnCoord(value, coords); } else { this.setSingleOnCoord(value, coords); } } } }
Tensor { public void setOnCoord(Object value, int... coords) { checkCoordsLength(coords); if (value != null) { if (this.isScalar()) { this.data = value; } else if (value.getClass().isArray()) { this.setArrayOnCoord(value, coords); } else { this.setSingleOnCoord(value, coords); } } } Tensor(DataType type, int[] shape);  Tensor(DataType type, TensorShape shape);  Tensor(DataType type, int[] shape, Object data);  Tensor(DataType type, TensorShape shape, Object data);  Tensor(DataType type, TensorShape shape, Object data, boolean nullableValues); }
Tensor { public void setOnCoord(Object value, int... coords) { checkCoordsLength(coords); if (value != null) { if (this.isScalar()) { this.data = value; } else if (value.getClass().isArray()) { this.setArrayOnCoord(value, coords); } else { this.setSingleOnCoord(value, coords); } } } Tensor(DataType type, int[] shape);  Tensor(DataType type, TensorShape shape);  Tensor(DataType type, int[] shape, Object data);  Tensor(DataType type, TensorShape shape, Object data);  Tensor(DataType type, TensorShape shape, Object data, boolean nullableValues); DataType getType(); void setType(DataType type); Object getData(); void setData(Object data); TensorShape getShape(); int[] getShapeAsArray(); void setShape(TensorShape shape); boolean isNullable(); Tensor slice(TensorShape begin, TensorShape size); Tensor concat(Tensor value, int axis); Object getCoord(int... coords); void setOnCoord(Object value, int... coords); Tensor toVector(); Iterator<int[]> coordIterator(); Iterator<int[]> coordIterator(int indexRollingWindows, int rollingWindowSize); Tensor reshape(TensorShape newShape); Tensor reshape(int[] newShape); Tensor reshapeWithType(TensorShape newShape, DataType dataType); Tensor reshapeWithType(int[] newShape, DataType dataType); int getRank(); boolean isScalar(); boolean isVector(); boolean isMatrix(); boolean isOfRank(int rank); void checkTypeCompatible(DataType wantedType); Object getDataAsList(); Tensor simplifyShape(); static Tensor fromData(DataType type, Object data); Tensor roll(int shapeIndex, int windowsSize); static Tensor fromIntData(Object data); static Tensor fromStringData(Object data); static Tensor fromLongData(Object data); static Tensor fromFloatData(Object data); static Tensor fromDoubleData(Object data); static Tensor fromBooleanData(Object data); Object jsonData(boolean simplify); Tensor apply(Function<Object, T> func, DataType outputDataType); }
Tensor { public void setOnCoord(Object value, int... coords) { checkCoordsLength(coords); if (value != null) { if (this.isScalar()) { this.data = value; } else if (value.getClass().isArray()) { this.setArrayOnCoord(value, coords); } else { this.setSingleOnCoord(value, coords); } } } Tensor(DataType type, int[] shape);  Tensor(DataType type, TensorShape shape);  Tensor(DataType type, int[] shape, Object data);  Tensor(DataType type, TensorShape shape, Object data);  Tensor(DataType type, TensorShape shape, Object data, boolean nullableValues); DataType getType(); void setType(DataType type); Object getData(); void setData(Object data); TensorShape getShape(); int[] getShapeAsArray(); void setShape(TensorShape shape); boolean isNullable(); Tensor slice(TensorShape begin, TensorShape size); Tensor concat(Tensor value, int axis); Object getCoord(int... coords); void setOnCoord(Object value, int... coords); Tensor toVector(); Iterator<int[]> coordIterator(); Iterator<int[]> coordIterator(int indexRollingWindows, int rollingWindowSize); Tensor reshape(TensorShape newShape); Tensor reshape(int[] newShape); Tensor reshapeWithType(TensorShape newShape, DataType dataType); Tensor reshapeWithType(int[] newShape, DataType dataType); int getRank(); boolean isScalar(); boolean isVector(); boolean isMatrix(); boolean isOfRank(int rank); void checkTypeCompatible(DataType wantedType); Object getDataAsList(); Tensor simplifyShape(); static Tensor fromData(DataType type, Object data); Tensor roll(int shapeIndex, int windowsSize); static Tensor fromIntData(Object data); static Tensor fromStringData(Object data); static Tensor fromLongData(Object data); static Tensor fromFloatData(Object data); static Tensor fromDoubleData(Object data); static Tensor fromBooleanData(Object data); Object jsonData(boolean simplify); Tensor apply(Function<Object, T> func, DataType outputDataType);  }