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

Function BM_Assign

tensorflow/core/framework/tensor_test.cc:1447–1459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1445BENCHMARK(BM_CreateAndDestroy);
1446
1447void BM_Assign(int iters) {
1448 Tensor a(DT_FLOAT, TensorShape({10, 20}));
1449 Tensor b(DT_FLOAT, TensorShape({10, 20}));
1450 bool a_to_b = true;
1451 while (--iters) {
1452 if (a_to_b) {
1453 b = a;
1454 } else {
1455 a = b;
1456 }
1457 a_to_b = !a_to_b;
1458 }
1459}
1460BENCHMARK(BM_Assign);
1461
1462// Ensure tensor_data() works on empty tensors

Callers

nothing calls this directly

Calls 1

TensorShapeClass · 0.70

Tested by

no test coverage detected