Unverified Commit f98173cc authored by Jonathan Kyl's avatar Jonathan Kyl Committed by GitHub
Browse files

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.
parent a4416b0e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment