From a3527d00479fa226c84231926a0ff57963faa3dd Mon Sep 17 00:00:00 2001 From: mamingjie-China Date: Mon, 21 Oct 2019 12:14:05 +0800 Subject: [PATCH] remove redundant code --- x2paddle/op_mapper/tf_op_mapper.py | 31 ------------------------------ 1 file changed, 31 deletions(-) diff --git a/x2paddle/op_mapper/tf_op_mapper.py b/x2paddle/op_mapper/tf_op_mapper.py index f4dbab3..c913744 100644 --- a/x2paddle/op_mapper/tf_op_mapper.py +++ b/x2paddle/op_mapper/tf_op_mapper.py @@ -1122,37 +1122,6 @@ class TFOpMapper(OpMapper): output=node, param_attr=None) - def RandomUniform(self, node): - shape = self.graph.get_node(node.layer.input[0], copy=True) - self.add_omit_nodes(shape.layer_name, node.layer_name) - if shape.layer_type == "Const": - shape = shape.value.tolist() - else: - shape = self.decoder.infer_shape_tensor(shape) - if node.tf_data_format == "NHWC" and len(shape) == 4: - shape = [shape[i] for i in [0, 3, 1, 2]] - attr = {"shape": shape, "min": 0.0, "max": 0.9999} - if shape[0] < 0: - input = self.batch_node - node.fluid_code.add_layer("uniform_random_batch_size_like", - inputs=input, - output=node, - param_attr=attr) - else: - node.fluid_code.add_layer("uniform_random", - inputs=None, - output=node, - param_attr=attr) - - def GreaterEqual(self, node): - x = self.graph.get_node(node.layer.input[0], copy=True) - y = self.graph.get_node(node.layer.input[1], copy=True) - inputs = {"x": x, "y": y} - node.fluid_code.add_layer("greater_equal", - inputs=inputs, - output=node, - param_attr=None) - def RandomUniform(self, node): shape = self.graph.get_node(node.layer.input[0], copy=True) self.add_omit_nodes(shape.layer_name, node.layer_name) -- GitLab