MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / fd_cast

Function fd_cast

fastdeploy/model_executor/utils.py:302–308  ·  view source on GitHub ↗
(weight, param)

Source from the content-addressed store, hash-verified

300
301
302def fd_cast(weight, param):
303 if weight.dtype != param.dtype:
304 if weight.dtype == paddle.int8 and param.dtype == paddle.float8_e4m3fn:
305 weight = weight.view(param.dtype)
306 else:
307 weight = weight.cast(param.dtype)
308 return weight
309
310
311def default_weight_loader(fd_config: FDConfig = None) -> None:

Callers 3

weight_loaderMethod · 0.90
weight_loaderMethod · 0.90
fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected