Hi,
I need to code a Jit compatible custom operation where the backward-pass depends on the value of a global variable defined in my python code.
Is there a way to do that?
In practice, that would correspond to the following piece of code in python
FOO = True
class MyFunnyFun(Funtion):
@staticmethod
def forward(ctx, x):
# return something
@staticmethod
def backward(ctx, grad_output):
if FOO:
# return something
else:
# return something else
Thanks!