MCPcopy Create free account
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-layers/src/engine/dataset_fakes.ts:98–113  ·  view source on GitHub ↗
(args: FakeDatasetArgs)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 1

mergeBatchSizeAndShapeFunction · 0.85

Tested by

no test coverage detected