You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ignored Module tests: provide required input tensor (#19028)
All 4 tests failed because they called forward() with zero arguments on
mobilenet_v2 which expects a [1,3,224,224] float input. This was a test
bug, not a runtime bug. Add a dummyInput() helper that creates a
Tensor.ones with the correct shape, and remove all @ignore annotations.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch/ModuleInstrumentationTest.kt
@@ -40,48 +39,49 @@ class ModuleInstrumentationTest {
40
39
inputStream.close()
41
40
}
42
41
43
-
@Ignore(
44
-
"The forward has failure that needs to be fixed before enabling this test: [Executorch Error 0x12] Invalid argument: Execution failed for method: forward "
val module =Module.load(getTestFilePath(TEST_FILE_NAME))
58
+
module.destroy()
59
59
}
60
60
61
-
@Ignore(
62
-
"The forward has failure that needs to be fixed before enabling this test: [Executorch Error 0x12] Invalid argument: Execution failed for method: forward "
63
-
)
64
61
@Test
65
62
@Throws(IOException::class)
66
63
funtestModuleLoadMethodAndForward() {
67
64
val module =Module.load(getTestFilePath(TEST_FILE_NAME))
65
+
try {
66
+
module.loadMethod(FORWARD_METHOD)
68
67
69
-
module.loadMethod(FORWARD_METHOD)
70
-
71
-
val results = module.forward()
72
-
Assert.assertTrue(results[0].isTensor)
68
+
val results = module.forward(EValue.from(dummyInput()))
69
+
Assert.assertTrue(results[0].isTensor)
70
+
} finally {
71
+
module.destroy()
72
+
}
73
73
}
74
74
75
-
@Ignore(
76
-
"The forward has failure that needs to be fixed before enabling this test: [Executorch Error 0x12] Invalid argument: Execution failed for method: forward "
77
-
)
78
75
@Test
79
76
@Throws(IOException::class)
80
77
funtestModuleLoadForwardExplicit() {
81
78
val module =Module.load(getTestFilePath(TEST_FILE_NAME))
82
-
83
-
val results = module.execute(FORWARD_METHOD)
84
-
Assert.assertTrue(results[0].isTensor)
79
+
try {
80
+
val results = module.execute(FORWARD_METHOD, EValue.from(dummyInput()))
81
+
Assert.assertTrue(results[0].isTensor)
82
+
} finally {
83
+
module.destroy()
84
+
}
85
85
}
86
86
87
87
@Test(expected =RuntimeException::class)
@@ -94,15 +94,18 @@ class ModuleInstrumentationTest {
94
94
@Throws(IOException::class)
95
95
funtestModuleLoadMethodNonExistantMethod() {
96
96
val module =Module.load(getTestFilePath(TEST_FILE_NAME))
"The forward has failure that needs to be fixed before enabling this test: [Executorch Error 0x12] Invalid argument: Execution failed for method: forward "
0 commit comments