From 47bee32f78f946c67f9a3ec239c262b5722a7767 Mon Sep 17 00:00:00 2001 From: Songhao Jia Date: Wed, 4 Jun 2025 14:05:45 -0700 Subject: [PATCH] remove raied error to solve ci issue. Summary: etrecord shouldn't raised error when user provide model doesn't have forward function. Remove the raised error to solve ci issue. Differential Revision: D75983673 --- devtools/etrecord/_etrecord.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devtools/etrecord/_etrecord.py b/devtools/etrecord/_etrecord.py index d5ad81fe255..ffb81a8e41a 100644 --- a/devtools/etrecord/_etrecord.py +++ b/devtools/etrecord/_etrecord.py @@ -162,7 +162,7 @@ def _get_reference_outputs( def _get_representative_inputs( bundled_program: BundledProgram, -) -> List[ProgramInput]: +) -> Optional[List[ProgramInput]]: """ Extracts out the inputs from the bundled program, keyed by the method names. """ @@ -175,7 +175,9 @@ def _get_representative_inputs( # Get first example input from the forward method test_case = method_test_suite.test_cases[0] return test_case.inputs - raise ValueError("No 'forward' method found in the bundled program.") + + # If the forward method is not defined, return None to indicate that there are no representative inputs for the model. + return None def generate_etrecord(