Internal change
PiperOrigin-RevId: 313473478 Change-Id: I53882ee616693d8f3006870786c153e470b4b939
This commit is contained in:
parent
75fc53e381
commit
8b1f77197a
@ -23,7 +23,6 @@ from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
|
||||
from tensorflow.python.eager import context
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import errors
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import random_seed
|
||||
from tensorflow.python.framework import test_util
|
||||
@ -416,13 +415,6 @@ class RandomUniformTest(RandomOpTestCommon):
|
||||
use_gpu=use_gpu,
|
||||
graph_seed=965)
|
||||
|
||||
def testUniformWithInvalidMaxMindShape(self):
|
||||
# Test case for GitHub issue 34363.
|
||||
with self.assertRaises(
|
||||
(errors.InvalidArgumentError, errors.UnknownError, ValueError)):
|
||||
array = array_ops.zeros(shape=(1,))
|
||||
random_ops.random_uniform(shape=(), minval=array)
|
||||
|
||||
|
||||
class RandomShapeTest(test.TestCase):
|
||||
|
||||
|
@ -304,12 +304,6 @@ def random_uniform(shape,
|
||||
if not maxval_is_one:
|
||||
result = math_ops.multiply(result, maxval)
|
||||
else:
|
||||
# Use explicit "broadcast_to" so that any shape incompatibility
|
||||
# are returned with InvalidArgument error.
|
||||
# This prevent "slient broadcast" that may cause the shape of
|
||||
# result "overflow" when minval or maxval is larger than expected shape
|
||||
maxval = array_ops.broadcast_to(maxval, shape)
|
||||
minval = array_ops.broadcast_to(minval, shape)
|
||||
result = math_ops.add(result * (maxval - minval), minval, name=name)
|
||||
# TODO(b/132092188): C++ shape inference inside functional ops does not
|
||||
# cross FuncGraph boundaries since that information is only available in
|
||||
|
Loading…
Reference in New Issue
Block a user