MCPcopy Index your code
hub / github.com/lutzroeder/netron / replaceFirstUseWith

Method replaceFirstUseWith

source/python.js:13254–13260  ·  view source on GitHub ↗
(newValue)

Source from the content-addressed store, hash-verified

13252 return this._value;
13253 }
13254 replaceFirstUseWith(newValue) {
13255 torch._C.AT_ASSERT(this.owningGraph() === newValue.owningGraph());
13256 const [u] = this.uses();
13257 u.user._inputs[u.offset] = newValue;
13258 newValue._uses.push(u);
13259 this._uses.shift();
13260 }
13261 replaceAllUsesWith(newValue) {
13262 while (this.uses().length > 0) {
13263 this.replaceFirstUseWith(newValue);

Callers 1

replaceAllUsesWithMethod · 0.80

Calls 3

owningGraphMethod · 0.80
usesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected