tensorflow/lite/kernels/strided_slice_test.cc
// This tests catches a very subtle bug that was fixed by cl/188403234.
This tests catches a very subtle bug that was fixed by cl/188403234.
This tests catches a very subtle bug that was fixed by cl / 188403234 .
TYPED_TEST(StridedSliceOpTest, RunTwice) {
  StridedSliceOpModel<TypeParam> m({2, 3}, {2}, {2}, {2}, 1, 0, 0, 0, 0);
  auto setup_inputs = [&m]() {
    m.SetInput({1, 2, 3, 4, 5, 6});
    m.SetBegin({1, 0});
    m.SetEnd({2, 2});
    m.SetStrides({1, 1});
  };
  setup_inputs();
  m.Invoke();
  EXPECT_THAT(m.GetOutput(), ElementsAreArray({1, 2, 4, 5}));
  setup_inputs();
  m.Invoke();
  EXPECT_THAT(m.GetOutput(), ElementsAreArray({1, 2, 4, 5}));
}
TYPED_TEST ( StridedSliceOpTest , RunTwice ) { StridedSliceOpModel < TypeParam > m ( { 2 , 3 } , { 2 } , { 2 } , { 2 } , 1 , 0 , 0 , 0 , 0 ) ; auto setup_inputs = [ & m ] ( ) { m . SetInput ( { 1 , 2 , 3 , 4 , 5 , 6 } ) ; m . SetBegin ( { 1 , 0 } ) ; m . SetEnd ( { 2 , 2 } ) ; m . SetStrides ( { 1 , 1 } ) ; } ; setup_inputs ( ) ; m . Invoke ( ) ; EXPECT_THAT ( m . GetOutput ( ) , ElementsAreArray ( { 1 , 2 , 4 , 5 } ) ) ; setup_inputs ( ) ; m . Invoke ( ) ; EXPECT_THAT ( m . GetOutput ( ) , ElementsAreArray ( { 1 , 2 , 4 , 5 } ) ) ; }
This tests catches a very subtle bug that was fixed by cl/188403234.
This tests catches a very subtle bug that was fixed by cl / 188403234 .
// Prior to cl/188403234 this was {4, 5}.