diff --git a/returnn/tensor/_dim_extra.py b/returnn/tensor/_dim_extra.py index 74dc18472f..bf4da5ca77 100644 --- a/returnn/tensor/_dim_extra.py +++ b/returnn/tensor/_dim_extra.py @@ -1182,6 +1182,8 @@ def _bin_op_tf(a, b): elif kind == "mul": return a * b elif kind in ("floordiv", "truediv"): # truediv assumes there is no remainder + if util.is_onnx_export_global(): + return tf_util.onnx_compat_floor_div(a, b) return a // b elif kind == "ceildiv": if util.is_onnx_export_global():