(args: FakeDatasetArgs)
| 96 | private tensorIndex = 0; |
| 97 | |
| 98 | constructor(args: FakeDatasetArgs) { |
| 99 | super(); |
| 100 | this.xBatchShape = mergeBatchSizeAndShape(args.batchSize, args.xShape); |
| 101 | this.yBatchShape = mergeBatchSizeAndShape(args.batchSize, args.yShape); |
| 102 | this.numBatches = args.numBatches; |
| 103 | this.batchCount = 0; |
| 104 | this.xTensorsFunc = args.xTensorsFunc; |
| 105 | this.yTensorsFunc = args.yTensorsFunc; |
| 106 | |
| 107 | // Sanity check on the preset tensors. |
| 108 | tfc.util.assert( |
| 109 | this.xTensorsFunc == null && this.yTensorsFunc == null || |
| 110 | this.xTensorsFunc != null && this.yTensorsFunc != null, |
| 111 | () => 'presetXTensors and presetYTensors must be both null/undefined ' + |
| 112 | 'or both set.'); |
| 113 | } |
| 114 | |
| 115 | async next(): Promise<IteratorResult<FitDatasetElement>> { |
| 116 | const done = ++this.batchCount > this.numBatches; |
nothing calls this directly
no test coverage detected