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

Function BM_CreateAndMoveCtrWithBuf

tensorflow/core/framework/tensor_test.cc:1490–1497  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1488
1489// Benchmark create+move a tensor, with an allocated buffer.
1490void BM_CreateAndMoveCtrWithBuf(int iters) {
1491 TensorShape shape({10, 20});
1492 Allocator* allocator = cpu_allocator();
1493 while (--iters) {
1494 Tensor a(allocator, DT_FLOAT, shape);
1495 Tensor b(std::move(a));
1496 }
1497}
1498BENCHMARK(BM_CreateAndMoveCtrWithBuf);
1499
1500// Benchmark creating and destroy a host-scalar tensor, using the allocator

Callers

nothing calls this directly

Calls 1

cpu_allocatorFunction · 0.85

Tested by

no test coverage detected