Caffe framework code equivalent in PyTorch

Hello there.

I’m trying for a while now to implement this Caffe code in PyTorch, since I am more familiar with the latter.

I am having trouble understanding this specific step in the training loop and how to implement it in pytorch.

generator.net.blobs['generated'].diff[...] = encoder.net.blobs['data'].diff + discriminator.net.blobs['data'].diff

The complete architecture consists of a generator a discriminator and a comparator.

I am more interested in understanding what this command does intuitively and what is the equivalent approach in pytorch, rather than the network’s specifics.

Thanks in advance