Allow functions of `DistributedVariable`s to implement `custom_gradient`
Previously, variables created by functions decorated with `custom_gradient` had to pass: ```python isinstance(v, resource_variable_ops.ResourceVariable) ``` Now, they must pass: ```python resource_variable_ops.is_resource_variable(v) ``` This allows functions of `DistributedVariables` (which already have the method `_should_act_as_resource_variable`) to implement `custom_gradient`, which is necessary for cross-replica batch normalization, among other things.
Loading
Please sign in to comment