Save the date! Google I/O returns May 18-20 Register now


Determine the script codes of a given tensor of Unicode integer code points.

This operation converts Unicode code points to script codes corresponding to each code point. Script codes correspond to International Components for Unicode (ICU) UScriptCode values. See Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will match input shape.


tf.strings.unicode_script([1, 31, 38])
<tf.Tensor: shape=(3,), dtype=int32, numpy=array([0, 0, 0], dtype=int32)>

input A Tensor of type int32. A Tensor of int32 Unicode code points.
name A name for the operation (optional).

A Tensor of type int32.