tensorflow/core/framework/tensor_test.cc
// Benchmark creating and destroy a host-scalar tensor, using the allocator
// interface.
Benchmark creating and destroy a host-scalar tensor, using the allocator
interface.
Benchmark creating and destroy a host - scalar tensor using the allocator interface .
void BM_CreateAndDestroyHostScalarNonOptimized(
    ::testing::benchmark::State& state) {
  TensorShape shape({});
  Allocator* allocator = cpu_allocator();
  for (auto s : state) {
    Tensor a(allocator, DT_FLOAT, shape);
    a.scalar<float>()() = 37.0;
  }
}
void BM_CreateAndDestroyHostScalarNonOptimized ( :: testing :: benchmark :: State & state ) { TensorShape shape ( { } ) ; Allocator * allocator = cpu_allocator ( ) ; for ( auto s : state ) { Tensor a ( allocator , DT_FLOAT , shape ) ; a . scalar < float > ( ) ( ) = 37.0 ; } }
Benchmark creating and destroy a host-scalar tensor, using the allocator
interface.
Benchmark creating and destroy a host - scalar tensor using the allocator interface .