MCPcopy
hub / github.com/tensorflow/tfjs / generateRandomTensorContainer

Function generateRandomTensorContainer

tfjs-layers/src/engine/dataset_fakes.ts:73–85  ·  view source on GitHub ↗
(shape: Shape|{[name: string]: Shape})

Source from the content-addressed store, hash-verified

71}
72
73function generateRandomTensorContainer(shape: Shape|{[name: string]: Shape}):
74 tfc.Tensor|{[name: string]: tfc.Tensor} {
75 let output: tfc.Tensor|{[name: string]: tfc.Tensor};
76 if (Array.isArray(shape)) {
77 output = tfc.randomNormal(shape);
78 } else {
79 output = {};
80 for (const name in shape) {
81 output[name] = tfc.randomNormal(shape[name]);
82 }
83 }
84 return output;
85}
86
87class FakeNumericIterator extends LazyIterator<FitDatasetElement> {
88 private xBatchShape: Shape|{[name: string]: Shape};

Callers 1

nextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…