1b8b1ee7ac530f74a31a72cd28add5ad5ec37c45,memcnn/models/revop.py,ReversibleModule,forward,#ReversibleModule#,89

Before Change


                    // PyTorch 1.0+ way to clear storage
                    input_tensor.storage().resize_(0)
            if self.training:
                xin.register_hook(hook=partial(signal_hook, rev_block=self, direction="forward"))
                y.register_hook(hook=partial(backward_hook, keep_input=self.keep_input, rev_block=self,
                                             compute_input_fn=self._fn.inverse, compute_output_fn=self._fn.forward,
                                             direction="forward", input_tensor=input_tensor, output_tensor=output_tensor))

After Change


                    input_tensor.storage().resize_(0)
            if self.training:
                self._valid_states.append(True)
                xin.register_hook(hook=partial(signal_hook, valid_states=self._valid_states, state_index=self._state_counter))
                y.register_hook(hook=partial(backward_hook, keep_input=self.keep_input,
                                             compute_input_fn=self._fn.inverse, compute_output_fn=self._fn.forward,
                                             valid_states=self._valid_states, state_index=self._state_counter,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: silvandeleemput/memcnn
Commit Name: 1b8b1ee7ac530f74a31a72cd28add5ad5ec37c45
Time: 2019-12-13
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: ReversibleModule
Method Name: forward


Project Name: silvandeleemput/memcnn
Commit Name: 1b8b1ee7ac530f74a31a72cd28add5ad5ec37c45
Time: 2019-12-13
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: ReversibleModule
Method Name: inverse


Project Name: tech-srl/code2vec
Commit Name: 89fcfe5f49502043e45de93c47acfc6de2180647
Time: 2019-04-05
Author: eladnah@gmail.com
File Name: keras_model.py
Class Name: Code2VecModel
Method Name: _create_metrics_for_keras_model