Fix reduction with a specified axis.
PiperOrigin-RevId: 286185937 Change-Id: I56bed77a84b758f204888102e8a7d7175b6e3d9e
This commit is contained in:
parent
6da1b29ae3
commit
949b18f0fe
@ -840,7 +840,7 @@ class Strategy(object):
|
|||||||
if dim is not None:
|
if dim is not None:
|
||||||
# By returning a python value in the static shape case, we can
|
# By returning a python value in the static shape case, we can
|
||||||
# maybe get a fast path for reducing the denominator.
|
# maybe get a fast path for reducing the denominator.
|
||||||
return numer, dim
|
return numer, array_ops.constant(dim, dtype=dtypes.int64)
|
||||||
elif axis < 0:
|
elif axis < 0:
|
||||||
axis = axis + array_ops.rank(v)
|
axis = axis + array_ops.rank(v)
|
||||||
if v.shape.rank == 1:
|
if v.shape.rank == 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user