8e12624641eab7a7e73497ea96124bb39aca1c01,memcnn/models/revop.py,InvertibleCheckpointFunction,forward,#,13

Before Change


        ctx.num_bwd_passes = num_bwd_passes

        with torch.no_grad():
            x = input_t.detach()  // Makes a detached copy which shares the storage
            output = ctx.fn(x)

        detached_output = output.detach_()  // Detaches y in-place (inbetween computations can now be discarded)

        // store these tensor nodes for backward pass
        ctx.input_t = [input_t] * num_bwd_passes

After Change




        if not isinstance(output, tuple):
            output = (output,)

        // Detaches y in-place (inbetween computations can now be discarded)
        detached_output = tuple([element.detach_() for element in output])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: silvandeleemput/memcnn
Commit Name: 8e12624641eab7a7e73497ea96124bb39aca1c01
Time: 2020-03-04
Author: ce377@orthosie.damtp.cam.ac.uk
File Name: memcnn/models/revop.py
Class Name: InvertibleCheckpointFunction
Method Name: forward


Project Name: Scitator/catalyst
Commit Name: e839626c28d8dc6030ce71f3619e934b36fb6627
Time: 2020-10-23
Author: Balaganskij.NN@phystech.edu
File Name: catalyst/metrics/functional.py
Class Name:
Method Name: get_multiclass_statistics


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 9503fd51007f3c31daa5a8c110c4b090d3644fdc
Time: 2018-12-13
Author: yanzhaoyi@outlook.com
File Name: models/accelerated_shift_net/accelerated_InnerShiftTripleFunction.py
Class Name: AcceleratedInnerShiftTripleFunction
Method Name: forward


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: d2c500803a9d7141a3933d0f4804d9635cd7bfc6
Time: 2018-12-13
Author: yanzhaoyi@outlook.com
File Name: models/soft_shift_net/innerSoftShiftTripleModule.py
Class Name: InnerSoftShiftTripleModule
Method Name: forward