tensorflow/core/framework/tensor_test.cc
// Benchmark create and destroy a tensor, with an allocated buffer.
Benchmark create and destroy a tensor, with an allocated buffer.
Benchmark create and destroy a tensor with an allocated buffer .
void BM_CreateAndDestroyWithBuf(::testing::benchmark::State& state) {
  TensorShape shape({10, 20});
  Allocator* allocator = cpu_allocator();
  for (auto s : state) {
    Tensor a(allocator, DT_FLOAT, shape);
  }
}
void BM_CreateAndDestroyWithBuf ( :: testing :: benchmark :: State & state ) { TensorShape shape ( { 10 , 20 } ) ; Allocator * allocator = cpu_allocator ( ) ; for ( auto s : state ) { Tensor a ( allocator , DT_FLOAT , shape ) ; } }
Benchmark create and destroy a tensor, with an allocated buffer.
Benchmark create and destroy a tensor with an allocated buffer .