MCPcopy Create free account
hub / github.com/apache/arrow / GetIndexValue

Method GetIndexValue

cpp/src/arrow/tensor/coo_converter.cc:258–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258int64_t SparseTensorConverterMixin::GetIndexValue(const uint8_t* value_ptr,
259 const int elsize) {
260 switch (elsize) {
261 case 1:
262 return *value_ptr;
263
264 case 2:
265 return *reinterpret_cast<const uint16_t*>(value_ptr);
266
267 case 4:
268 return *reinterpret_cast<const uint32_t*>(value_ptr);
269
270 case 8:
271 return *reinterpret_cast<const int64_t*>(value_ptr);
272
273 default:
274 return 0;
275 }
276}
277
278Status MakeSparseCOOTensorFromTensor(const Tensor& tensor,
279 const std::shared_ptr<DataType>& index_value_type,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected