From 9d3474174cfc298317e03cde403fcddffb4fe188 Mon Sep 17 00:00:00 2001 From: Gerstenberger Date: Tue, 7 Nov 2023 02:25:29 +0100 Subject: [PATCH] TF fix ceildiv in _DimMixin.complete_dyn_size --- returnn/tensor/_dim_extra.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/returnn/tensor/_dim_extra.py b/returnn/tensor/_dim_extra.py index 4635e79fc9..74dc18472f 100644 --- a/returnn/tensor/_dim_extra.py +++ b/returnn/tensor/_dim_extra.py @@ -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)