Fixes for multi-GPU continuous integration failures.

1) Test central storage strategy against numpy dataset.
2) Implement non-overridden methods from Variable in AggregatingVariable.
3) Make ResourceVariableSaveable support `is_resource_variable` instances.

PiperOrigin-RevId: 243518258
This commit is contained in:
Tom Hennigan 2019-04-14 12:41:00 -07:00 committed by TensorFlower Gardener
parent ff206a3fde
commit e4b9fda1d0
3 changed files with 10 additions and 3 deletions

View File

@ -925,10 +925,10 @@ class CentralStorageStrategyTest(strategy_test_lib.DistributionTestBase,
@combinations.generate(combinations.combine(mode=['graph', 'eager'],
use_core_strategy=[True, False],
required_gpus=2))
def testNumpyIterator(self, use_core_strategy):
def testNumpyDataset(self, use_core_strategy):
strategy, _, _ = create_test_objects(
num_gpus=2, use_core_strategy=use_core_strategy)
self._test_numpy_iterator(strategy)
self._test_numpy_dataset(strategy)
if __name__ == '__main__':

View File

@ -1567,6 +1567,13 @@ class AggregatingVariable(variables_lib.Variable):
def initializer(self):
return self._v.initializer
@property
def op(self):
return self._v.op
def read_value(self):
return self._v.read_value()
def eval(self, session=None):
return self._v.eval(session)

View File

@ -81,7 +81,7 @@ class ResourceVariableSaveable(saveable_object.SaveableObject):
if isinstance(var, ops.Tensor):
self.handle_op = var.op.inputs[0]
tensor = var
elif isinstance(var, resource_variable_ops.ResourceVariable):
elif resource_variable_ops.is_resource_variable(var):
def _read_variable_closure(v):
def f():