a0138726cc5814df6cbcade4eccd771d70046106,test.py,,prepare_inputs,#Any#Any#,11
Before Change
next_begin_index = batch_size
else:
inputs = torch.cat(
[input_buffer[i] for i in range(buffer_index)] +
[input_buffer[buffer_index][:-n_over_samples]],
dim=0)
next_begin_index = input_buffer[buffer_index].size(0) - n_over_samples
After Change
def prepare_inputs(input_buffer, batch_size):
n_input_samples = 0
for buffer_index, x in enumerate(input_buffer):
n_input_samples += x.size(0)
if n_input_samples >= batch_size:
n_over_samples = n_input_samples - batch_size
break
else:
n_over_samples = 0
if n_over_samples == 0:
inputs = torch.cat(input_buffer[:(buffer_index + 1)], dim=0)
input_buffer = input_buffer[(buffer_index + 1):]
else:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: a0138726cc5814df6cbcade4eccd771d70046106
Time: 2018-11-06
Author: kensho.hara@aist.go.jp
File Name: test.py
Class Name:
Method Name: prepare_inputs
Project Name: matplotlib/matplotlib
Commit Name: 4ffbeeb8283181fb9cd5193bb34de13ce513bd14
Time: 2019-04-02
Author: tcaswell@gmail.com
File Name: lib/matplotlib/textpath.py
Class Name: TextToPath
Method Name: _get_ps_font_and_encoding
Project Name: allenai/allennlp
Commit Name: 40ec35876d38c4797ad3ee9bf911b019faa5a61d
Time: 2017-08-25
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: __call__