MCPcopy Index your code
hub / github.com/tensorflow/tfjs / encodeString

Function encodeString

tfjs-core/src/util.ts:118–121  ·  view source on GitHub ↗
(s: string, encoding = 'utf-8')

Source from the content-addressed store, hash-verified

116 * @doc {heading: 'Util'}
117 */
118export function encodeString(s: string, encoding = 'utf-8'): Uint8Array {
119 encoding = encoding || 'utf-8';
120 return env().platform.encode(s, encoding);
121}
122
123/**
124 * Decodes the provided bytes into a string using the provided encoding scheme.

Callers 5

encodeStringsFunction · 0.90
tensor_test.tsFile · 0.90
io_utils_test.tsFile · 0.90
fromStringArrayToUint8Function · 0.90
createScalarValueFunction · 0.85

Calls 2

envFunction · 0.90
encodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…