| 1445 | BENCHMARK(BM_CreateAndDestroy); |
| 1446 | |
| 1447 | void 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 | } |
| 1460 | BENCHMARK(BM_Assign); |
| 1461 | |
| 1462 | // Ensure tensor_data() works on empty tensors |
nothing calls this directly
no test coverage detected