We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99e30bc + 6488dd4 commit 83cd3fdCopy full SHA for 83cd3fd
tensorflow/python/ops/variable_scope.py
@@ -683,6 +683,9 @@ def _get_single_variable(self,
683
init_val = initializer
684
variable_dtype = None
685
else:
686
+ # Instantiate initializer if provided initializer is a type object.
687
+ if isinstance(initializer, type(init_ops.Initializer)):
688
+ initializer=initializer(dtype=dtype)
689
init_val = lambda: initializer( # pylint: disable=g-long-lambda
690
shape.as_list(), dtype=dtype, partition_info=partition_info)
691
variable_dtype = dtype.base_dtype
0 commit comments