MCPcopy
hub / github.com/tensorflow/tfjs / toList

Function toList

tfjs-layers/src/utils/generic_utils.ts:79–84  ·  view source on GitHub ↗
(x: T|T[])

Source from the content-addressed store, hash-verified

77 */
78// tslint:disable-next-line:no-any
79export function toList<T>(x: T|T[]): T[] {
80 if (Array.isArray(x)) {
81 return x;
82 }
83 return [x];
84}
85
86/**
87 * Generate a UID for a list

Callers 3

executeFunction · 0.90
fitDatasetFunction · 0.90
objectListUidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…