Skip to content

Commit 0fd7761

Browse files
deivanayakisankaralingamdeivanayakisankaralingam
authored andcommitted
fix issue by updated the retrieval of value arg
1 parent e1abc2c commit 0fd7761

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/tvm/relax/frontend/torch/base_fx_graph_translator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,8 @@ def _pad(self, node: fx.Node) -> relax.Var:
879879
x = self.env[node.args[0]]
880880
pad = node.args[1]
881881
mode = node.args[2] if len(node.args) > 2 else node.kwargs.get("mode", "constant")
882-
value = node.args[3] if len(node.args) > 3 else 0.0
882+
value = node.args[3] if len(node.args) > 3 else node.kwargs.get("value", 0.0)
883+
value = 0.0 if value is None else value
883884

884885
# Calculate symmetric padding width for each dimension
885886
# and applying them in reverse order to match the input dimensions.

0 commit comments

Comments
 (0)