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

Function pyListRepeat

tfjs-layers/src/utils/generic_utils.ts:24–37  ·  view source on GitHub ↗
(value: any, numValues: number)

Source from the content-addressed store, hash-verified

22 */
23// tslint:disable-next-line:no-any
24export function pyListRepeat(value: any, numValues: number): any[] {
25 if (Array.isArray(value)) {
26 // tslint:disable-next-line:no-any
27 let newArray: any[] = [];
28 for (let i = 0; i < numValues; i++) {
29 newArray = newArray.concat(value);
30 }
31 return newArray;
32 } else {
33 const newArray = new Array(numValues);
34 newArray.fill(value);
35 return newArray;
36 }
37}
38
39export function assert(val: boolean, message?: string): void {
40 if (!val) {

Callers 4

normalizeArrayFunction · 0.90
training_test.tsFile · 0.90
core_test.tsFile · 0.90

Calls 1

concatMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…