MCPcopy Create free account
hub / github.com/NVIDIA/DALI / CopyIds

Method CopyIds

dali/operators/reader/coco_reader_op_test.cc:109–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 int ObjectCount(bool masks) { return masks ? 7 : 194; }
108
109 std::vector<int> CopyIds(Workspace &ws, int ids_out_idx = 3) {
110 auto &output = ws.Output<dali::CPUBackend>(ids_out_idx);
111 const auto &shape = output.shape();
112
113 vector<int> ids(shape.size());
114
115 auto *out_ptr = ids.data();
116 for (int sample_idx = 0; sample_idx < shape.num_samples(); sample_idx++) {
117 MemCopy(
118 out_ptr,
119 output.tensor<int>(sample_idx),
120 shape[sample_idx].num_elements() * sizeof(int));
121 out_ptr += shape[sample_idx].num_elements();
122 }
123 cudaStreamSynchronize(0);
124 return ids;
125 }
126
127 void RunTestForPipeline(Pipeline &pipe, bool ltrb, bool ratio, bool skip_empty, int expected_size,
128 bool polygon_masks = false, bool polygon_masks_legacy = false) {

Callers 1

TEST_FFunction · 0.80

Calls 6

MemCopyFunction · 0.85
shapeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
num_samplesMethod · 0.45
num_elementsMethod · 0.45

Tested by

no test coverage detected