Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Crepaldi committed Jun 15, 2022
1 parent 2b1c1a5 commit eeff5f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion detectron2/export/c10.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def has(self, name):
return name in self.batch_extra_fields

def set(self, name, value):
# len(tensor) leads to constants during tracing mode
# len(tensor) is a bad practice that generates ONNX constants during tracing.
# Although not a problem for the `assert` statement below, torch ONNX exporter
# still raises a misleading warning as it does not this call comes from `assert`
if isinstance(value, Boxes):
data_len = value.tensor.shape[0]
elif isinstance(value, torch.Tensor):
Expand Down

0 comments on commit eeff5f2

Please sign in to comment.