Make TODO a bit more specific.

PiperOrigin-RevId: 168051381
This commit is contained in:
A. Unique TensorFlower 2017-09-08 15:02:56 -07:00 committed by TensorFlower Gardener
parent c779384bc5
commit 6e402d0d2c

View File

@ -736,10 +736,9 @@ def cast(x, dtype, name=None):
values_cast = cast(x.values, base_type, name=name)
return sparse_tensor.SparseTensor(x.indices, values_cast, x.dense_shape)
else:
# TODO(touts): Handle what Josh said.
#
# Could return ops.convert_to_tensor(x, dtype=dtype, ...) here, but that
# allows some conversions that cast() can't do, e.g. casting numbers to
# TODO(josh11b): If x is not already a Tensor, we could return
# ops.convert_to_tensor(x, dtype=dtype, ...) here, but that
# allows some conversions that cast() can't do, e.g. casting numbers to
# strings.
x = ops.convert_to_tensor(x, name="x")
if x.dtype.base_dtype == base_type: