fix strings.split
diff --git a/tensorflow/python/ops/ragged/ragged_string_ops.py b/tensorflow/python/ops/ragged/ragged_string_ops.py
index 5064f2f..2fe676b 100644
--- a/tensorflow/python/ops/ragged/ragged_string_ops.py
+++ b/tensorflow/python/ops/ragged/ragged_string_ops.py
@@ -22,6 +22,7 @@
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_string_ops
+from tensorflow.python.ops import gen_array_ops
from tensorflow.python.ops import string_ops
from tensorflow.python.ops.ragged import ragged_array_ops
from tensorflow.python.ops.ragged import ragged_math_ops
@@ -630,6 +631,8 @@
if result_type == "SparseTensor" and input.shape.rank == 1:
return string_ops.string_split_v2(input, sep=sep, maxsplit=maxsplit)
+ if result_type == "SparseTensor" and input.shape.rank==0:
+ input = gen_array_ops.expand_dims(input, 0)
ragged_result = string_split_v2(input, sep=sep, maxsplit=maxsplit)
if result_type == "SparseTensor":
return ragged_result.to_sparse()