MCPcopy Create free account
hub / github.com/tensorflow/tfjs / formatAsFriendlyString

Function formatAsFriendlyString

tfjs-layers/src/utils/generic_utils.ts:466–476  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

464 */
465// tslint:disable-next-line:no-any
466export function formatAsFriendlyString(value: any): string {
467 if (value === null) {
468 return 'null';
469 } else if (Array.isArray(value)) {
470 return '[' + value.map(v => formatAsFriendlyString(v)).join(',') + ']';
471 } else if (typeof value === 'string') {
472 return `"${value}"`;
473 } else {
474 return `${value}`;
475 }
476}
477
478/**
479 * Returns a function `f2` (decorator) which wraps the original function

Callers 1

assertPositiveIntegerFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…