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

Function BM_CreateAndCopyCtrWithBuf

tensorflow/core/framework/tensor_test.cc:1479–1486  ·  view source on GitHub ↗

Benchmark create+copy a tensor, with an allocated buffer.

Source from the content-addressed store, hash-verified

1477
1478// Benchmark create+copy a tensor, with an allocated buffer.
1479void BM_CreateAndCopyCtrWithBuf(int iters) {
1480 TensorShape shape({10, 20});
1481 Allocator* allocator = cpu_allocator();
1482 while (--iters) {
1483 Tensor a(allocator, DT_FLOAT, shape);
1484 Tensor b(a);
1485 }
1486}
1487BENCHMARK(BM_CreateAndCopyCtrWithBuf);
1488
1489// Benchmark create+move a tensor, with an allocated buffer.

Callers

nothing calls this directly

Calls 1

cpu_allocatorFunction · 0.85

Tested by

no test coverage detected