MCPcopy Create free account
hub / github.com/abess-team/abess / test_multiple_dims

Function test_multiple_dims

python/include/unsupported/test/cxx11_tensor_ref.cpp:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70static void test_multiple_dims()
71{
72 Tensor<float, 3> input(3,5,7);
73 input.setRandom();
74
75 TensorRef<Tensor<float, 3>> ref(input);
76 VERIFY_IS_EQUAL(ref.data(), input.data());
77 VERIFY_IS_EQUAL(ref.dimension(0), 3);
78 VERIFY_IS_EQUAL(ref.dimension(1), 5);
79 VERIFY_IS_EQUAL(ref.dimension(2), 7);
80
81 for (int i = 0; i < 3; ++i) {
82 for (int j = 0; j < 5; ++j) {
83 for (int k = 0; k < 7; ++k) {
84 VERIFY_IS_EQUAL(ref(i,j,k), input(i,j,k));
85 }
86 }
87 }
88}
89
90
91static void test_slice()

Callers 1

test_cxx11_tensor_refFunction · 0.85

Calls 2

dataMethod · 0.45
dimensionMethod · 0.45

Tested by

no test coverage detected