e588f6b3985622c42299f7136925aa68d91f1cef,dnc/sparse_memory.py,SparseMemory,reset,#SparseMemory#Any#Any#Any#,84
Before Change
"read_vectors": cuda(T.zeros(b, r, w).fill_(δ), gpu_id=self.gpu_id),
"last_used_mem": cuda(T.zeros(b, 1), gpu_id=self.gpu_id).long(),
"usage": cuda(T.zeros(b, m), gpu_id=self.gpu_id),
"read_positions": cuda(T.zeros(b, 1, r).fill_(0), gpu_id=self.gpu_id).long()
}
hidden = self.rebuild_indexes(hidden, erase=True)
else:
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"]
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: OpenNMT/OpenNMT-py
Commit Name: dbd4344f433498232ab26da5af3ba142f9accb51
Time: 2018-02-01
Author: s.gehrmann@outlook.com
File Name: onmt/io/TextDataset.py
Class Name: TextDataset
Method Name: collapse_copy_scores
Project Name: pytorch/examples
Commit Name: 1c6d9d276f3a0c484226996ab7f9df4f90ce52f4
Time: 2017-06-05
Author: bartolsthoorn@gmail.com
File Name: dcgan/main.py
Class Name:
Method Name: