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

Method check

tfjs-core/src/io/composite_array_buffer.ts:170–178  ·  view source on GitHub ↗
(shard: BufferShard)

Source from the content-addressed store, hash-verified

168 // shard. That means we need a function to check where the byteIndex lies
169 // relative to a given shard.
170 function check(shard: BufferShard) {
171 if (byteIndex < shard.start) {
172 return -1;
173 }
174 if (byteIndex >= shard.end) {
175 return 1;
176 }
177 return 0;
178 }
179
180 // For efficiency, try the previous shard first.
181 if (check(this.shards[this.previousShardIndex]) === 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected