13ba9a024d50038d94706beeb5267a88a1a2ac5e,mmdnn/conversion/tensorflow/tensorflow_emitter.py,TensorflowEmitter,emit_Constant,#TensorflowEmitter#Any#,150

Before Change




    def emit_Constant(self, IR_node):
        self.add_body(1, "{:<15} = tf.constant(__weights_dict["{}"]["value"], name="{}")".format(
            IR_node.variable_name,
            IR_node.name,
            IR_node.name
        ))


    def emit_Pool(self, IR_node):
        pooling_type = IR_node.get_attr("pooling_type")

After Change


            dtype_str = "{}".format(self.dtype_map[IR_node.layer.attr["dtype"].type])
        else:
            dtype_str = "tf.float32"
        code = "{:<15} = tf.constant({}, dtype={}, name="{}")".format(
            IR_node.variable_name,
            "__weights_dict["{}"]["value"]".format(IR_node.name) if not IR_node.get_attr("value") else IR_node.get_attr("value"),
            dtype_str,
            IR_node.name)

        return code

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Microsoft/MMdnn
Commit Name: 13ba9a024d50038d94706beeb5267a88a1a2ac5e
Time: 2019-01-07
Author: 42927787+rainLiuplus@users.noreply.github.com
File Name: mmdnn/conversion/tensorflow/tensorflow_emitter.py
Class Name: TensorflowEmitter
Method Name: emit_Constant


Project Name: Microsoft/MMdnn
Commit Name: 13ba9a024d50038d94706beeb5267a88a1a2ac5e
Time: 2019-01-07
Author: 42927787+rainLiuplus@users.noreply.github.com
File Name: mmdnn/conversion/tensorflow/tensorflow_emitter.py
Class Name: TensorflowEmitter
Method Name: emit_Slice


Project Name: Microsoft/MMdnn
Commit Name: 13ba9a024d50038d94706beeb5267a88a1a2ac5e
Time: 2019-01-07
Author: 42927787+rainLiuplus@users.noreply.github.com
File Name: mmdnn/conversion/tensorflow/tensorflow_emitter.py
Class Name: TensorflowEmitter
Method Name: emit_Conv