MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RandomZeroOrOne

Function RandomZeroOrOne

tensorflow/core/kernels/sdca_ops_test.cc:104–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104Node* RandomZeroOrOne(Graph* const g, const int n) {
105 Tensor data(DT_FLOAT, TensorShape({n}));
106 test::FillFn<float>(&data, [](const int i) {
107 // Fill with 0.0 or 1.0 at random.
108 return (random::New64() % 2) == 0 ? 0.0f : 1.0f;
109 });
110 return test::graph::Constant(g, data);
111}
112
113Node* RandomZeroOrOneMatrix(Graph* const g, const int n, int d) {
114 Tensor data(DT_FLOAT, TensorShape({n, d}));

Callers 1

GetGraphsFunction · 0.85

Calls 3

New64Function · 0.85
ConstantFunction · 0.70
TensorShapeClass · 0.50

Tested by

no test coverage detected