MCPcopy Create free account
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-layers/src/engine/executor.ts:67–83  ·  view source on GitHub ↗

* Constructor, optionally does copy-construction. * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case * copy-construction will be performed.

(feeds?: Feed[]|FeedDict)

Source from the content-addressed store, hash-verified

65 * copy-construction will be performed.
66 */
67 constructor(feeds?: Feed[]|FeedDict) {
68 if (feeds instanceof FeedDict) {
69 for (const id in feeds.id2Value) {
70 this.id2Value[id] = feeds.id2Value[id];
71 if (id in feeds.id2Mask) {
72 this.id2Mask[id] = feeds.id2Mask[id];
73 }
74 }
75 } else {
76 if (feeds == null) {
77 return;
78 }
79 for (const feed of feeds) {
80 this.add(feed.key, feed.value);
81 }
82 }
83 }
84
85 /**
86 * Add a key-value pair to the FeedDict.

Callers

nothing calls this directly

Calls 1

addMethod · 0.95

Tested by

no test coverage detected