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

Function Array4DLinearIndex

tensorflow/compiler/xla/array4d_test.cc:30–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28// array idx represents.
29template <typename T>
30int64 Array4DLinearIndex(const Array4D<T>& arr, absl::Span<const int64> idx) {
31 EXPECT_EQ(4, idx.size());
32 return (idx[3] + idx[2] * arr.n4() + idx[1] * arr.n3() * arr.n4() +
33 idx[0] * arr.n2() * arr.n3() * arr.n4());
34}
35
36TEST(Array4dTest, UninitializedDimsCtor) {
37 Array4D<int> empty(2, 3, 4, 5);

Callers 1

TESTFunction · 0.85

Calls 4

n4Method · 0.80
sizeMethod · 0.45
n3Method · 0.45
n2Method · 0.45

Tested by

no test coverage detected