(*args, promote=False)
| 58 | |
| 59 | |
| 60 | def cast_tensors(*args, promote=False): |
| 61 | if promote: |
| 62 | dtype = _get_amp_high_prec_dtype() |
| 63 | else: |
| 64 | dtype = _get_amp_low_prec_dtype() |
| 65 | return tuple(arg.astype(dtype) if arg is not None else None for arg in args) |
| 66 | |
| 67 | |
| 68 | def result_type(*args): |
no test coverage detected