View source on GitHub
|
Infers the result dtype from a list of input types, backend-agnostically.
meridian.backend.result_type(
*types
) -> str
This acts as the single source of truth for type promotion rules. The promotion logic is designed to be consistent across all backends.
Rule: If any input is a float, the result is float32. Otherwise, the result is int64 to match NumPy/JAX's default behavior for precision.
Args | |
|---|---|
*types
|
A variable number of type objects (e.g., <class 'int'>,
np.dtype('float32')).
|
Returns | |
|---|---|
| A string representing the promoted dtype. |
View source on GitHub