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

Function RandomZeroOrOneMatrix

tensorflow/core/kernels/sdca_ops_test.cc:113–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113Node* RandomZeroOrOneMatrix(Graph* const g, const int n, int d) {
114 Tensor data(DT_FLOAT, TensorShape({n, d}));
115 test::FillFn<float>(&data, [](const int i) {
116 // Fill with 0.0 or 1.0 at random.
117 return (random::New64() % 2) == 0 ? 0.0f : 1.0f;
118 });
119 return test::graph::Constant(g, data);
120}
121
122void GetGraphs(const int32 num_examples, const int32 num_sparse_feature_groups,
123 const int32 sparse_features_per_group,

Callers 1

GetGraphsFunction · 0.85

Calls 3

New64Function · 0.85
ConstantFunction · 0.70
TensorShapeClass · 0.50

Tested by

no test coverage detected