Skip to content

Commit c109241

Browse files
Merge pull request #1123 from onnx/tom/CastLogToFloat2
Added cast to float before log
2 parents d5e56d5 + 6d0ee53 commit c109241

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tf2onnx/onnx_opset/math.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ def version_1(cls, ctx, node, **kwargs):
4848

4949
@classmethod
5050
def version_6(cls, ctx, node, **kwargs):
51-
pass
51+
if node.type == "Log":
52+
# ORT doesn't implement Log on doubles
53+
double_to_float = {onnx_pb.TensorProto.DOUBLE: onnx_pb.TensorProto.FLOAT}
54+
node.maybe_cast_input([[onnx_pb.TensorProto.FLOAT]], double_to_float)
5255

5356

5457
@tf_op(["Acos", "Asin", "Atan", "Cos", "Sin", "Tan"])

0 commit comments

Comments
 (0)