You shouldn’t attach parameters to autograd.Function. Instead, please pass them as an argument of forward. If you need them to be trainable, make them Parameters of a Module, otherwise make them Buffers of a Module.