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

Function nameScope

tfjs-layers/src/common.ts:45–55  ·  view source on GitHub ↗
(name: string, fn: () => T)

Source from the content-addressed store, hash-verified

43 * Enter namescope, which can be nested.
44 */
45export function nameScope<T>(name: string, fn: () => T): T {
46 _nameScopeStack.push(name);
47 try {
48 const val: T = fn();
49 _nameScopeStack.pop();
50 return val;
51 } catch (e) {
52 _nameScopeStack.pop();
53 throw e;
54 }
55}
56
57/**
58 * Get the current namescope as a flat, concatenated string.

Callers 6

variables_test.tsFile · 0.90
compileMethod · 0.90
handleMetricsMethod · 0.90
applyFunction · 0.90
buildMethod · 0.90
buildMethod · 0.90

Calls 2

pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…