Function
encode_string_array
(string_array, encoding="utf-8")
Source from the content-addressed store, hash-verified
| 106 | |
| 107 | |
| 108 | def encode_string_array(string_array, encoding="utf-8"): |
| 109 | string_array = np.asarray(string_array) |
| 110 | encoded = [x.encode(encoding) for x in string_array.ravel()] |
| 111 | return np.array(encoded, dtype=bytes).reshape(string_array.shape) |
| 112 | |
| 113 | |
| 114 | def ensure_fixed_length_bytes(var: Variable) -> Variable: |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…