| 51 | } |
| 52 | |
| 53 | void ValidateAssets(const string& export_dir, |
| 54 | const SavedModelBundle& bundle) { |
| 55 | const string asset_directory = |
| 56 | io::JoinPath(export_dir, kSavedModelAssetsDirectory); |
| 57 | const string asset_filename = "foo.txt"; |
| 58 | const string asset_filepath = io::JoinPath(asset_directory, asset_filename); |
| 59 | TF_EXPECT_OK(Env::Default()->FileExists(asset_filepath)); |
| 60 | |
| 61 | std::vector<Tensor> path_outputs; |
| 62 | TF_ASSERT_OK( |
| 63 | bundle.session->Run({}, {"filename_tensor:0"}, {}, &path_outputs)); |
| 64 | ASSERT_EQ(1, path_outputs.size()); |
| 65 | |
| 66 | test::ExpectTensorEqual<tstring>( |
| 67 | test::AsTensor<tstring>({"foo.txt"}, TensorShape({})), path_outputs[0]); |
| 68 | } |
| 69 | |
| 70 | void CheckSavedModelBundle(const string& export_dir, |
| 71 | const SavedModelBundle& bundle) { |
nothing calls this directly
no test coverage detected