[PT FE] Raise graceful exception when model has incorrect type (#18976)
* [PT FE] Raise graceful exception when model has incorrect type * Improve message
This commit is contained in:
@@ -1106,3 +1106,11 @@ class ConvertRaises(unittest.TestCase):
|
||||
with self.assertRaisesRegex(Exception, ".*Conversion is failed for: aten::relu.*"):
|
||||
convert_model(pt_model, input=(inp_shapes, np.float32), extensions=[
|
||||
ConversionExtension("aten::relu", relu_bad)])
|
||||
|
||||
def test_failed_extension(self):
|
||||
import tempfile
|
||||
from openvino.tools.mo import convert_model
|
||||
|
||||
with self.assertRaisesRegex(Exception, ".*PyTorch Frontend doesn't support provided model type.*"):
|
||||
with tempfile.NamedTemporaryFile() as tmpfile:
|
||||
convert_model(tmpfile.name, framework="pytorch")
|
||||
|
||||
Reference in New Issue
Block a user