e588f6b3985622c42299f7136925aa68d91f1cef,dnc/sparse_memory.py,SparseMemory,reset,#SparseMemory#Any#Any#Any#,84

Before Change


        hidden["read_vectors"].data.fill_(δ)
        hidden["last_used_mem"].data.fill_(0)
        hidden["usage"].data.fill_(0)
        hidden["read_positions"].data.fill_(0)
    return hidden

  def write_into_sparse_memory(self, hidden):
    read_vectors = hidden["read_vectors"]

After Change


        hidden["read_vectors"].data.fill_(δ)
        hidden["last_used_mem"].data.fill_(0)
        hidden["usage"].data.fill_(δ)
        hidden["read_positions"] = cuda(T.arange(0, r).expand(b, 1, r), gpu_id=self.gpu_id).long()
    return hidden

  def write_into_sparse_memory(self, hidden):
    read_vectors = hidden["read_vectors"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ixaxaar/pytorch-dnc
Commit Name: e588f6b3985622c42299f7136925aa68d91f1cef
Time: 2017-12-06
Author: root@ixaxaar.in
File Name: dnc/sparse_memory.py
Class Name: SparseMemory
Method Name: reset


Project Name: elbayadm/attn2d
Commit Name: c2165224d198450a3b4329ae099a772aa65d51c5
Time: 2019-10-08
Author: changhan@fb.com
File Name: fairseq/models/levenshtein_transformer.py
Class Name: LevenshteinTransformerModel
Method Name: forward_decoder