MCPcopy Create free account
hub / github.com/apple/coremltools / read_fp16_data

Method read_fp16_data

milstoragepython/MilStorage.cpp:208–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208py::array_t<uint16_t> MilStoragePythonReader::read_fp16_data(uint64_t offset) {
209
210 auto fpView = m_reader->GetDataView<MILBlob::Fp16>(offset);
211 auto intView = MILBlob::Util::SpanCast<const uint16_t>(fpView);
212
213 return py::array_t<uint16_t> (intView.Size(), intView.Data());
214}
215
216py::array_t<float> MilStoragePythonReader::read_float_data(uint64_t offset) {
217 return readData<float>(*m_reader, offset);

Callers 2

test_weight_blob_fp16Method · 0.80
_load_file_valueFunction · 0.80

Calls 2

SizeMethod · 0.45
DataMethod · 0.45

Tested by 1

test_weight_blob_fp16Method · 0.64