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

Function BM_CreateAndDestroyWithBuf

tensorflow/core/framework/tensor_test.cc:1469–1475  ·  view source on GitHub ↗

Benchmark create and destroy a tensor, with an allocated buffer.

Source from the content-addressed store, hash-verified

1467
1468// Benchmark create and destroy a tensor, with an allocated buffer.
1469void BM_CreateAndDestroyWithBuf(int iters) {
1470 TensorShape shape({10, 20});
1471 Allocator* allocator = cpu_allocator();
1472 while (--iters) {
1473 Tensor a(allocator, DT_FLOAT, shape);
1474 }
1475}
1476BENCHMARK(BM_CreateAndDestroyWithBuf);
1477
1478// Benchmark create+copy a tensor, with an allocated buffer.

Callers

nothing calls this directly

Calls 1

cpu_allocatorFunction · 0.85

Tested by

no test coverage detected