cerebras.modelzoo.common.half_dtype.set_half_dtype_from_params#

cerebras.modelzoo.common.half_dtype.set_half_dtype_from_params(params: Dict[str, Any]) torch.dtype[source]#

Sets the half dtype in cstorch from the given model params.

Note that after this call, reading the half dtype from params is discouraged. Instead, use cstorch.amp.get_half_dtype() to get the dtype to use in the model.

Parameters

params – Model params where to find “fp16_type” key.

Returns

The proxy dtype to use in the model.