Skip to content

Rename tests/models to tests/modules #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions tests/models/simple_net.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/models/BUILD → tests/modules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test_suite(
tests = [
":test_modules_as_engines",
":test_compiled_modules",
":test_multiple_registered_engines"
]
)

Expand Down
9 changes: 9 additions & 0 deletions tests/modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Module Level Tests

These tests focus on integration testing of the backend, using the public apis. They require TorchScript modules saved to files. You can download the set of modules used by default in the tests by running hub.py (you need PyTorch 1.4.0) installed.

## Running Tests

``` shell
bazel test //tests/modules:test_modules --compilation_mode=dbg --test_output=errors
```
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ TEST_P(ModuleTests, CompiledModuleIsClose) {
INSTANTIATE_TEST_SUITE_P(CompiledModuleForwardIsCloseSuite,
ModuleTests,
testing::Values(
PathAndInSize({"tests/models/lenet.jit.pt",
PathAndInSize({"tests/modules/lenet.jit.pt",
{{1,1,28,28}}}),
PathAndInSize({"tests/models/resnet18.jit.pt",
PathAndInSize({"tests/modules/resnet18.jit.pt",
{{1,3,224,224}}}),
PathAndInSize({"tests/models/resnet50.jit.pt",
PathAndInSize({"tests/modules/resnet50.jit.pt",
{{1,3,224,224}}})));
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ TEST_P(ModuleTests, ModuleAsEngineIsClose) {
INSTANTIATE_TEST_SUITE_P(ModuleAsEngineForwardIsCloseSuite,
ModuleTests,
testing::Values(
PathAndInSize({"tests/models/lenet.jit.pt",
PathAndInSize({"tests/modules/lenet.jit.pt",
{{1,1,28,28}}}),
PathAndInSize({"tests/models/resnet18.jit.pt",
PathAndInSize({"tests/modules/resnet18.jit.pt",
{{1,3,224,224}}}),
PathAndInSize({"tests/models/resnet50.jit.pt",
PathAndInSize({"tests/modules/resnet50.jit.pt",
{{1,3,224,224}}})));
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ TEST(ModuleTests, CanRunMultipleEngines) {
torch::jit::script::Module mod1;
torch::jit::script::Module mod2;
try {
mod1 = torch::jit::load("tests/models/resnet50.jit.pt");
mod2 = torch::jit::load("tests/models/resnet18.jit.pt");
mod1 = torch::jit::load("tests/modules/resnet50.jit.pt");
mod2 = torch::jit::load("tests/modules/resnet18.jit.pt");
}
catch (const c10::Error& e) {
std::cerr << "error loading the model\n";
Expand Down