diff --git a/tensorflow/python/ops/linalg_ops.py b/tensorflow/python/ops/linalg_ops.py index 03b7b98119d..08e734e9091 100644 --- a/tensorflow/python/ops/linalg_ops.py +++ b/tensorflow/python/ops/linalg_ops.py @@ -24,6 +24,7 @@ from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import control_flow_ops +from tensorflow.python.ops import gen_array_ops from tensorflow.python.ops import gen_linalg_ops from tensorflow.python.ops import linalg_ops_impl from tensorflow.python.ops import map_fn @@ -732,7 +733,8 @@ def norm(tensor, ops.convert_to_tensor(axis)) axes = math_ops.range(rank) perm_before = array_ops.concat( - [array_ops.setdiff1d(axes, positive_axis)[0], positive_axis], + [gen_array_ops.list_diff(axes, positive_axis, dtypes.int32)[0], + positive_axis], axis=0) perm_after = map_fn.map_fn( lambda i: math_ops.cast( diff --git a/tensorflow/python/ops/math_grad.py b/tensorflow/python/ops/math_grad.py index 463ad8337c7..389f6f8dce9 100644 --- a/tensorflow/python/ops/math_grad.py +++ b/tensorflow/python/ops/math_grad.py @@ -297,7 +297,7 @@ def _ProdGrad(op, grad): reduction_indices = (reduction_indices + rank) % rank reduced = math_ops.cast(reduction_indices, dtypes.int32) idx = math_ops.range(0, rank) - other, _ = array_ops.setdiff1d(idx, reduced) + other, _ = gen_array_ops.list_diff(idx, reduced, dtypes.int32) perm = array_ops.concat([reduced, other], 0) reduced_num = math_ops.reduce_prod(array_ops.gather(input_shape, reduced)) other_num = math_ops.reduce_prod(array_ops.gather(input_shape, other)) diff --git a/tensorflow/python/ops/math_ops.py b/tensorflow/python/ops/math_ops.py index c29fd8f1477..2d14c6f8b65 100644 --- a/tensorflow/python/ops/math_ops.py +++ b/tensorflow/python/ops/math_ops.py @@ -4514,7 +4514,7 @@ def tensordot(a, b, axes, name=None): rank_a = array_ops.rank(a) axes = ops.convert_to_tensor(axes, dtype=dtypes.int32, name="axes") axes = array_ops.where(axes >= 0, axes, axes + rank_a) - free, _ = array_ops.setdiff1d(range(rank_a), axes) + free, _ = gen_array_ops.list_diff(range(rank_a), axes, dtypes.int32) free_dims = array_ops.gather(shape_a, free) axes_dims = array_ops.gather(shape_a, axes) prod_free_dims = reduce_prod(free_dims)