@tom Many thanks! To clarify, in my function forward, i need to check for (noise.defined()) instead of (noise==None) . But if I want to call my function “forward” with noise undefined, how do i do that without setting a default value for noise in the function? I just do " torch::Tensor noise_dummy;" and pass in noise_dummy?