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)
|
values_cast = cast(x.values, base_type, name=name)
|
||||||
return sparse_tensor.SparseTensor(x.indices, values_cast, x.dense_shape)
|
return sparse_tensor.SparseTensor(x.indices, values_cast, x.dense_shape)
|
||||||
else:
|
else:
|
||||||
# TODO(touts): Handle what Josh said.
|
# TODO(josh11b): If x is not already a Tensor, we could return
|
||||||
#
|
# ops.convert_to_tensor(x, dtype=dtype, ...) here, but that
|
||||||
# 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
|
||||||
# allows some conversions that cast() can't do, e.g. casting numbers to
|
|
||||||
# strings.
|
# strings.
|
||||||
x = ops.convert_to_tensor(x, name="x")
|
x = ops.convert_to_tensor(x, name="x")
|
||||||
if x.dtype.base_dtype == base_type:
|
if x.dtype.base_dtype == base_type:
|
||||||
|
Loading…
Reference in New Issue
Block a user