Skip to content

Commit

Permalink
update interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jiweibo committed Sep 4, 2021
1 parent 51985a3 commit d20b149
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_skip_case(
self.skip_cases.append((teller, reason, note))

@abc.abstractmethod
def is_program_validity(self, program_config: ProgramConfig) -> bool:
def is_program_valid(self, program_config: ProgramConfig) -> bool:
raise NotImplementedError

def run_test_config(self, model, params, prog_config, pred_config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


class TrtConvertConv2dTest(TrtLayerAutoScanTest):
def is_program_validity(self, program_config: ProgramConfig) -> bool:
def is_program_valid(self, program_config: ProgramConfig) -> bool:
# TODO: This is just the example to remove the wrong attrs.
inputs = program_config.inputs
weights = program_config.weights
Expand Down Expand Up @@ -110,10 +110,6 @@ def generate_weight1(attrs: List[Dict[str, Any]]):
},
outputs=["relu_output_data"])

# if program is invalid, we should skip that cases.
if not self.is_program_validity(program_config):
continue

yield program_config

def sample_predictor_configs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def run_test(self, quant=False):
status = True

for prog_config in self.sample_program_configs():
# if program is invalid, we should skip that cases.
if not self.is_program_valid(prog_config):
continue

model, params = create_fake_model(prog_config)
if quant:
model, params = create_quant_model(model, params)
Expand Down Expand Up @@ -208,6 +212,7 @@ def run_test(self, quant=False):
inference_config_str(pred_config))
else:
raise NotImplementedError
break

try:
results.append(
Expand Down

1 comment on commit d20b149

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.