JCBrouwer / maua-stylegan2

This is the repo for my experiments with StyleGAN2. There are many like it, but this one is mine. Contains code for the paper Audio-reactive Latent Interpolations with StyleGAN.
https://wavefunk.xyz/audio-reactive-stylegan
179 stars 29 forks source link

about method 'apply' #26

Closed hui-vigil closed 1 year ago

hui-vigil commented 1 year ago

hi,UpFirDn2d.apply( inp, kernel, (up, up), (down, down), (pad[0], pad[1], pad[0], pad[1]) ) but i didn't found the method 'apply' in class UpFirDn2d or Function, could you tell where the 'apply' defined, thank you

JCBrouwer commented 1 year ago

This is a method defined by the super class, torch.autograd.Function.

Basically, you define the forward and backward pass for the operation and then using .apply() ensures that PyTorch's autograd keeps track of all the graph info / gradients correctly.