The result will be differentiable with autograd – you can use anything in Python as long as you don’t manually modify a variable’s .data attribute; it’ll throw an error if you do something non-differentiable.