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

Method write_fp16_data

milstoragepython/MilStorage.cpp:110–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110u_int64_t MilStoragePythonWriter::write_fp16_data(const py::array_t<uint16_t>& data){
111
112 auto intSpan = MILBlob::Util::Span<const uint16_t>(data.data(), data.size());
113 auto fpSpan = MILBlob::Util::SpanCast<const MILBlob::Fp16>(intSpan);
114
115 return m_writer->WriteData(fpSpan);
116}
117
118u_int64_t MilStoragePythonWriter::write_float_data(const py::array_t<float>& data){
119 return writeData<float>(*m_writer, data);

Callers 2

test_weight_blob_fp16Method · 0.80

Calls 3

sizeMethod · 0.65
dataMethod · 0.45
WriteDataMethod · 0.45

Tested by 1

test_weight_blob_fp16Method · 0.64