Make TODO a bit more specific.
PiperOrigin-RevId: 168051381
This commit is contained in:
parent
c779384bc5
commit
6e402d0d2c
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user