bc714964ae754c25af66ded19ae2926768362584,dnc/dnc.py,DNC,_init_hidden,#DNC#Any#Any#Any#,123

Before Change


    if chx is None:
      chx = cuda(T.zeros(self.num_layers, batch_size, self.output_size), gpu_id=self.gpu_id)
      if self.rnn_type.lower() == "lstm":
        chx = (chx, chx)

    // Last read vectors
    if last_read is None:
      last_read = cuda(T.zeros(batch_size, self.w * self.r), gpu_id=self.gpu_id)

After Change


    // initialize hidden state of the controller RNN
    if chx is None:
      chx = cuda(T.zeros(batch_size, self.output_size), gpu_id=self.gpu_id)
      if self.rnn_type.lower() == "lstm":
        chx = [ [ (chx.clone(), chx.clone()) for h in range(self.num_hidden_layers) ] for l in range(self.num_layers) ]
      else:
        chx = [ [ chx.clone() for h in range(self.num_hidden_layers) ] for l in range(self.num_layers) ]

    // Last read vectors
    if last_read is None:
      last_read = cuda(T.zeros(batch_size, self.w * self.r), gpu_id=self.gpu_id)

    // memory states
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: ixaxaar/pytorch-dnc
Commit Name: bc714964ae754c25af66ded19ae2926768362584
Time: 2017-10-29
Author: root@ixaxaar.in
File Name: dnc/dnc.py
Class Name: DNC
Method Name: _init_hidden


Project Name: explosion/thinc
Commit Name: 3c7d4d1240103e4c06a0110b00e11b7e1002dd0e
Time: 2020-01-12
Author: honnibal+gh@gmail.com
File Name: thinc/layers/lstm.py
Class Name:
Method Name: LSTM


Project Name: ixaxaar/pytorch-dnc
Commit Name: 4c335da8e73ecdac2d298c89a1652b587edd1086
Time: 2017-10-29
Author: root@ixaxaar.in
File Name: dnc/dnc.py
Class Name: DNC
Method Name: _init_hidden