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

Function cloneIfTensor

tfjs-data/src/util/deep_clone.ts:27–35  ·  view source on GitHub ↗
(item: any)

Source from the content-addressed store, hash-verified

25
26// tslint:disable-next-line: no-any
27function cloneIfTensor(item: any): DeepMapResult {
28 if (item instanceof tf.Tensor) {
29 return ({value: item.clone(), recurse: false});
30 } else if (isIterable(item)) {
31 return {value: null, recurse: true};
32 } else {
33 return {value: item, recurse: false};
34 }
35}

Callers

nothing calls this directly

Calls 2

isIterableFunction · 0.90
cloneMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…