| 256 | } |
| 257 | |
| 258 | int64_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 | |
| 278 | Status MakeSparseCOOTensorFromTensor(const Tensor& tensor, |
| 279 | const std::shared_ptr<DataType>& index_value_type, |
nothing calls this directly
no outgoing calls
no test coverage detected