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

Method unshift

tfjs-data/src/util/ring_buffer.ts:137–143  ·  view source on GitHub ↗

* Adds an item to the beginning of the buffer.

(value: T)

Source from the content-addressed store, hash-verified

135 * Adds an item to the beginning of the buffer.
136 */
137 unshift(value: T) {
138 if (this.isFull()) {
139 throw new RangeError('Ring buffer is full.');
140 }
141 this.begin = this.wrap(this.begin - 1);
142 this.set(this.begin, value);
143 }
144
145 /**
146 * Removes and returns the first item in the buffer.

Callers 7

analyzeSplitStringFunction · 0.45
getLogFilesFunction · 0.45
getBroadcastDimsFunction · 0.45
getReductionAxesFunction · 0.45
broadcastTo_Function · 0.45
enterFrameMethod · 0.45

Calls 3

isFullMethod · 0.95
wrapMethod · 0.95
setMethod · 0.95

Tested by

no test coverage detected