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

Function canTensorify

tfjs-data/src/util/deep_map.ts:279–283  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

277 */
278// tslint:disable-next-line:no-any
279export function canTensorify(obj: any): boolean {
280 return obj == null || isPrimitive(obj) || Array.isArray(obj) ||
281 (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||
282 tf.util.isTypedArray(obj);
283}
284
285/**
286 * Returns true if the given `value` is a primitive type. Otherwise returns

Callers 2

deepBatchConcatFunction · 0.90
deep_map_test.tsFile · 0.90

Calls 2

isPrimitiveFunction · 0.85
isTypedArrayMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…