8e12624641eab7a7e73497ea96124bb39aca1c01,memcnn/models/revop.py,InvertibleCheckpointFunction,forward,#Any#Any#Any#Any#Any#Any#,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



        with torch.no_grad():
            // Makes a detached copy which shares the storage
            x = [element.detach() for element in input_t]
            output = ctx.fn(*x)


        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])

        // store these tensor nodes for backward pass
        ctx.input_t = [input_t] * num_bwd_passes
        ctx.output_t = [detached_output] * num_bwd_passes
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: silvandeleemput/memcnn
Commit Name: 375f42176d438788acac405e5982914ce04aa43f
Time: 2020-03-01
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: InvertibleModuleWrapper
Method Name: inverse


Project Name: silvandeleemput/memcnn
Commit Name: 375f42176d438788acac405e5982914ce04aa43f
Time: 2020-03-01
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: InvertibleModuleWrapper
Method Name: forward