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

Method FillUnique

tensorflow/compiler/xla/array2d.h:79–86  ·  view source on GitHub ↗

Fills the array with a pattern of values of the form: (rowno << log2ceil(width) | colno) + start_value This makes it easy to see distinct row/column values in the array.

Source from the content-addressed store, hash-verified

77 //
78 // This makes it easy to see distinct row/column values in the array.
79 void FillUnique(T start_value = 0) {
80 for (int64 i0 = 0; i0 < n1(); ++i0) {
81 for (int64 i1 = 0; i1 < n2(); ++i1) {
82 (*this)(i0, i1) =
83 ((i0 << tensorflow::Log2Ceiling64(n2())) | i1) + start_value;
84 }
85 }
86 }
87
88 // Applies f to all cells in this array, in row-major order.
89 void Each(std::function<void(int64, int64, T*)> f) {

Callers 9

TEST_FFunction · 0.80
TEST_PFunction · 0.80
TestWithArrayMethod · 0.80
XLA_TEST_FFunction · 0.80
TEST_PFunction · 0.80
XLA_TEST_PFunction · 0.80
XLA_TEST_PFunction · 0.80
XLA_TEST_PFunction · 0.80

Calls 1

Log2Ceiling64Function · 0.85

Tested by 9

TEST_FFunction · 0.64
TEST_PFunction · 0.64
TestWithArrayMethod · 0.64
XLA_TEST_FFunction · 0.64
TEST_PFunction · 0.64
XLA_TEST_PFunction · 0.64
XLA_TEST_PFunction · 0.64
XLA_TEST_PFunction · 0.64