提交 a21c5164 编写于 作者: B BBuf

fix commnets

上级 bc690741
......@@ -121,12 +121,26 @@ class Flatten:
assert dtype == 1, f"onnx opset version 1/9 only support float32 data_type!"
assert start_dim >= 0, f"oneflow flatten can't support neagetive dim now!"
node.attrs["axis"] = start_dim
@classmethod
def Version_9(cls, ctx, node, **kwargs):
start_dim = node.attrs.get("start_dim", 1)
dtype = ctx.get_dtype(node.input_tensor_names[0])
assert dtype == 1, f"onnx opset version 1/9 only support float32 data_type!"
assert start_dim >= 0, f"oneflow flatten can't support neagetive dim now!"
node.attrs["axis"] = start_dim
@classmethod
def Version_11(cls, ctx, node, **kwargs):
start_dim = node.attrs.get("start_dim", 1)
assert start_dim >= 0, f"oneflow flatten can't support neagetive dim now!"
node.attrs["axis"] = start_dim
@classmethod
def Version_13(cls, ctx, node, **kwargs):
start_dim = node.attrs.get("start_dim", 1)
assert start_dim >= 0, f"oneflow flatten can't support neagetive dim now!"
node.attrs["axis"] = start_dim
@flow_op("squeeze", "Squeeze")
class Squeeze:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册