Skip to content

Commit

Permalink
update to latest benchmark API changes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 402826803
  • Loading branch information
tensorflower-gardener authored and tensorflow-copybara committed Oct 13, 2021
1 parent 774779a commit 860e101
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ TEST_F(BundleFactoryUtilTest, EstimateResourceFromPathWithGoodExport) {

void BM_HalfPlusTwo(benchmark::State& state) {
static Session* session;
if (state.thread_index == 0) {
if (state.thread_index() == 0) {
SavedModelBundle bundle;
TF_ASSERT_OK(LoadSavedModel(SessionOptions(), RunOptions(),
test_util::GetTestSavedModelPath(), {"serve"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ TEST(TfLiteSession, TestSetScheduler) {

static void BM_Reshape(benchmark::State& state, bool use_flex_op) {
static TfLiteSession* session;
if (state.thread_index == 0) {
if (state.thread_index() == 0) {
auto model_signature_def_map = GetTestSignatureDefMap();
string model_bytes = BuildTestModel(tflite::TensorType_INT32, use_flex_op,
&model_signature_def_map);
Expand Down Expand Up @@ -848,7 +848,7 @@ BENCHMARK(BM_Reshape_Flex)->UseRealTime()->ThreadRange(1, 64);

void BM_HalfPlusTwo(benchmark::State& state) {
static TfLiteSession* session;
if (state.thread_index == 0) {
if (state.thread_index() == 0) {
string model_bytes;
TF_ASSERT_OK(ReadFileToString(
Env::Default(), test_util::TestSrcDirPath(kTestModel), &model_bytes));
Expand All @@ -871,7 +871,7 @@ BENCHMARK(BM_HalfPlusTwo)->UseRealTime()->ThreadRange(1, 64);

void BM_MobileNet(benchmark::State& state) {
static TfLiteSession* session;
if (state.thread_index == 0) {
if (state.thread_index() == 0) {
string model_bytes;
TF_ASSERT_OK(ReadFileToString(Env::Default(),
test_util::TestSrcDirPath(kMobileNetModel),
Expand All @@ -897,7 +897,7 @@ BENCHMARK(BM_MobileNet)->UseRealTime()->ThreadRange(1, 64);

void BM_ParseExample(benchmark::State& state) {
static TfLiteSession* session;
if (state.thread_index == 0) {
if (state.thread_index() == 0) {
string model_bytes;
TF_ASSERT_OK(ReadFileToString(Env::Default(),
test_util::TestSrcDirPath(kParseExampleModel),
Expand Down

0 comments on commit 860e101

Please sign in to comment.