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

Method Partitioner

tensorflow/core/kernels/unique_ali_op_util.h:105–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103struct Partitioner {
104 public:
105 explicit Partitioner(int64 work_size, int32 num_parts) {
106 if (work_size <= 0 || num_parts <= 0) { return; }
107 num_parts_ = num_parts;
108 parts_.reserve(num_parts);
109 int64 start = 0;
110 for (int32 i = 0; i < num_parts; ++i) {
111 int64 end = start + (work_size + i) / num_parts;
112 parts_.emplace_back(Range(start, end));
113 start = end;
114 }
115 }
116
117 const Range* GetRange(const int32 id) const {
118 if (id < 0 || id >= num_parts_) { return nullptr; }

Callers

nothing calls this directly

Calls 3

RangeClass · 0.70
reserveMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected