Skip to content

Commit

Permalink
Added cast to float before log
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wildenhain <tomwi@microsoft.com>
  • Loading branch information
TomWildenhain-Microsoft committed Oct 5, 2020
1 parent d5e56d5 commit ee3b48e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tf2onnx/onnx_opset/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
cast_node = node.maybe_cast_input([[onnx_pb.TensorProto.FLOAT]], double_to_float)


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

0 comments on commit ee3b48e

Please sign in to comment.