@Test void testBuildWithoutIndexes() { List<TensorField> schema1 = List.of( new TensorField( "tensor_input", DataType.INTEGER, new int[]{-1, 2}, null ) ); List<TensorField> schema2 = List.of( new TensorField( "tensor_input", DataType.INTEGER, new int[]{-1, 2}, new ArrayList<>() ) ); TensorIO input = new TensorIO( Map.of( "tensor_input", new Tensor( DataType.INTEGER, new int[]{3, 2}, new int[][]{ new int[]{1, 2}, new int[]{3, 4}, new int[]{5, 6} }) ) ); for (List<TensorField> schema : List.of(schema1, schema2)) { TensorIO outputMainNoSimp = new TensorIOIntoTensorIO(schema, false).build(input); TensorIO outputIndexNoSimp = new TensorIOIntoTensorIO(schema, true).build(input); for (TensorIO output : List.of(outputMainNoSimp, outputIndexNoSimp)) { assertEquals(1, output.getTensors().size()); assertEquals(DataType.INTEGER, output.getTensor("tensor_input").getType()); assertArrayEquals(new int[]{3, 2}, output.getTensor("tensor_input").getShape().getArrayShape()); assertArrayEquals(new int[][]{ new int[]{1, 2}, new int[]{3, 4}, new int[]{5, 6}, }, (int[][]) output.getTensor("tensor_input").getData()); } } }
@Override public TensorIO build(TensorIO input) throws EvaluationException { Map<String, Tensor> outputMap; if (this.buildIndexes) { outputMap = this.buildIndexes(input); } else { outputMap = this.buildMain(input); } return new TensorIO(outputMap); }
TensorIOIntoTensorIO implements Builder<TensorIO, TensorIO> { @Override public TensorIO build(TensorIO input) throws EvaluationException { Map<String, Tensor> outputMap; if (this.buildIndexes) { outputMap = this.buildIndexes(input); } else { outputMap = this.buildMain(input); } return new TensorIO(outputMap); } }
TensorIOIntoTensorIO implements Builder<TensorIO, TensorIO> { @Override public TensorIO build(TensorIO input) throws EvaluationException { Map<String, Tensor> outputMap; if (this.buildIndexes) { outputMap = this.buildIndexes(input); } else { outputMap = this.buildMain(input); } return new TensorIO(outputMap); } TensorIOIntoTensorIO(List<? extends TensorField> tensorFields);  TensorIOIntoTensorIO(List<? extends TensorField> tensorFields, boolean buildIndexes);  TensorIOIntoTensorIO(
        List<? extends TensorField> tensorFields,
        boolean buildIndexes,
        int rollingWindowsSize); }
TensorIOIntoTensorIO implements Builder<TensorIO, TensorIO> { @Override public TensorIO build(TensorIO input) throws EvaluationException { Map<String, Tensor> outputMap; if (this.buildIndexes) { outputMap = this.buildIndexes(input); } else { outputMap = this.buildMain(input); } return new TensorIO(outputMap); } TensorIOIntoTensorIO(List<? extends TensorField> tensorFields);  TensorIOIntoTensorIO(List<? extends TensorField> tensorFields, boolean buildIndexes);  TensorIOIntoTensorIO(
        List<? extends TensorField> tensorFields,
        boolean buildIndexes,
        int rollingWindowsSize); @Override TensorIO build(TensorIO input); }
TensorIOIntoTensorIO implements Builder<TensorIO, TensorIO> { @Override public TensorIO build(TensorIO input) throws EvaluationException { Map<String, Tensor> outputMap; if (this.buildIndexes) { outputMap = this.buildIndexes(input); } else { outputMap = this.buildMain(input); } return new TensorIO(outputMap); } TensorIOIntoTensorIO(List<? extends TensorField> tensorFields);  TensorIOIntoTensorIO(List<? extends TensorField> tensorFields, boolean buildIndexes);  TensorIOIntoTensorIO(
        List<? extends TensorField> tensorFields,
        boolean buildIndexes,
        int rollingWindowsSize); @Override TensorIO build(TensorIO input);  }