MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Block

Method Block

tensorflow/core/lib/io/block.cc:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34Block::Block(const BlockContents& contents)
35 : data_(contents.data.data()),
36 size_(contents.data.size()),
37 owned_(contents.heap_allocated) {
38 if (size_ < sizeof(uint32)) {
39 size_ = 0; // Error marker
40 } else {
41 size_t max_restarts_allowed = (size_ - sizeof(uint32)) / sizeof(uint32);
42 if (NumRestarts() > max_restarts_allowed) {
43 // The size is too small for NumRestarts()
44 size_ = 0;
45 } else {
46 restart_offset_ = size_ - (1 + NumRestarts()) * sizeof(uint32);
47 }
48 }
49}
50
51Block::~Block() {
52 if (owned_) {

Callers 5

resnet_v1_blockFunction · 0.80
resnet_v2_blockFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by 3

TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64