MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / convert_uint16_to_float

Function convert_uint16_to_float

python/paddle/base/data_feeder.py:129–134  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

127
128
129def convert_uint16_to_float(data):
130 new_data = np.vectorize(
131 lambda x: struct.unpack('<f', struct.pack('<I', x << 16))[0],
132 otypes=[np.float32],
133 )(data.flat)
134 return np.reshape(new_data, data.shape)
135
136
137def convert_dtype(dtype: DTypeLike) -> _DTypeLiteral:

Callers 2

itemFunction · 0.90
updateMethod · 0.50

Calls 1

reshapeMethod · 0.45

Tested by

no test coverage detected