b3bc509ad60a7ce5befbb50275a350d5959ea520,mmdnn/conversion/pytorch/pytorch_emitter.py,PytorchEmitter,emit_Embedding,#PytorchEmitter#Any#,362

Before Change



    def emit_Embedding(self, IR_node):
        raise NotImplementedError()
        ret = "{:<15} = Embedding(input_dim = {}, output_dim = {}, mask_zero = {})({})".format(
                IR_node.name,
                IR_node.IR_layer.attr["input_dim"].i,
                IR_node.IR_layer.attr["output_dim"].i,
                IR_node.IR_layer.attr["mask_zero"].b,
                IR_node.in_edges[0])

        return ret

After Change



    def emit_Embedding(self, IR_node):
        self.used_layers.add("Embedding")
        self.add_init(2, "self.{} = self.__embedding("{}", num_embeddings={}, embedding_dim={})".format(
            IR_node.variable_name,
            IR_node.name,
            IR_node.get_attr("input_dim"),   /ǘ-D
            IR_node.get_attr("output_dim")
            ))
        self.add_body(2, "{:<15} = self.{}({})".format(
            IR_node.variable_name,
            IR_node.variable_name,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: Microsoft/MMdnn
Commit Name: b3bc509ad60a7ce5befbb50275a350d5959ea520
Time: 2018-10-25
Author: 42927787+rainLiuplus@users.noreply.github.com
File Name: mmdnn/conversion/pytorch/pytorch_emitter.py
Class Name: PytorchEmitter
Method Name: emit_Embedding


Project Name: Microsoft/MMdnn
Commit Name: b3bc509ad60a7ce5befbb50275a350d5959ea520
Time: 2018-10-25
Author: 42927787+rainLiuplus@users.noreply.github.com
File Name: mmdnn/conversion/pytorch/pytorch_emitter.py
Class Name: PytorchEmitter
Method Name: emit_Embedding


Project Name: Microsoft/MMdnn
Commit Name: da6852d07ac747bb608fa0ea6586a642179b5284
Time: 2020-03-23
Author: 50827462+XiaoXYe@users.noreply.github.com
File Name: mmdnn/conversion/mxnet/mxnet_emitter.py
Class Name: MXNetEmitter
Method Name: emit_LRN


Project Name: Microsoft/MMdnn
Commit Name: da6852d07ac747bb608fa0ea6586a642179b5284
Time: 2020-03-23
Author: 50827462+XiaoXYe@users.noreply.github.com
File Name: mmdnn/conversion/cntk/cntk_emitter.py
Class Name: CntkEmitter
Method Name: emit_LRN