MCPcopy Index your code
hub / github.com/apache/tvm / withNewScope

Method withNewScope

web/src/runtime.ts:1011–1016  ·  view source on GitHub ↗

* Perform action under a new scope. * * @param action The action function. * @returns The result value. * * Note: For action to return a valid value, * we will need to call moveToParentScope * for the objects that are created in the scope.

(action: () => T)

Source from the content-addressed store, hash-verified

1009 * for the objects that are created in the scope.
1010 */
1011 withNewScope<T>(action: () => T): T {
1012 this.beginScope();
1013 const val = action();
1014 this.endScope();
1015 return val;
1016 }
1017
1018 /**
1019 * Attach a detached obj to the auto-release pool of the current scope.

Callers 6

benchmarkMethod · 0.95
listGlobalFuncNamesMethod · 0.95
registerFuncMethod · 0.95
test_tensor.jsFile · 0.80
test_object.jsFile · 0.80

Calls 2

beginScopeMethod · 0.95
endScopeMethod · 0.95

Tested by

no test coverage detected