From 6d0ee5398c2de0cfb710f68cdf627a6d3a3a8858 Mon Sep 17 00:00:00 2001 From: Tom Wildenhain Date: Mon, 5 Oct 2020 12:45:16 -0400 Subject: [PATCH] Added cast to float before log Signed-off-by: Tom Wildenhain --- tf2onnx/onnx_opset/math.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tf2onnx/onnx_opset/math.py b/tf2onnx/onnx_opset/math.py index 742e1b23c..6d941394f 100644 --- a/tf2onnx/onnx_opset/math.py +++ b/tf2onnx/onnx_opset/math.py @@ -48,7 +48,10 @@ def version_1(cls, ctx, node, **kwargs): @classmethod def version_6(cls, ctx, node, **kwargs): - pass + if node.type == "Log": + # ORT doesn't implement Log on doubles + double_to_float = {onnx_pb.TensorProto.DOUBLE: onnx_pb.TensorProto.FLOAT} + node.maybe_cast_input([[onnx_pb.TensorProto.FLOAT]], double_to_float) @tf_op(["Acos", "Asin", "Atan", "Cos", "Sin", "Tan"])