Oh, I see. This now has the full context.
What you can maybe do is implement a separate function within your subclassed model that returns the desired gradients and have it invoked within the strategy scope. I haven’t tried this method myself so cannot confirm its effectiveness but I still think it’s worth trying.