Skip to content

Commit

Permalink
TF fix ceildiv in _DimMixin.complete_dyn_size
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerstenberger committed Nov 7, 2023
1 parent 09f1048 commit 9d34741
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions returnn/tensor/_dim_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,8 @@ def _bin_op_tf(a, b):
elif kind in ("floordiv", "truediv"): # truediv assumes there is no remainder
return a // b
elif kind == "ceildiv":
if util.is_onnx_export_global():
return -tf_util.onnx_compat_floor_div(-a, b)
return -(-a // b)
else:
raise ValueError("unknown op kind %r" % op.kind)
Expand Down

0 comments on commit 9d34741

Please sign in to comment.