(quant_type: str, device: torch.device)
| 67 | |
| 68 | |
| 69 | def _get_4bit_code(quant_type: str, device: torch.device) -> torch.Tensor: |
| 70 | key = (quant_type, device) |
| 71 | if key not in _code_4bit_cache: |
| 72 | from bitsandbytes.functional import get_4bit_type |
| 73 | |
| 74 | _code_4bit_cache[key] = get_4bit_type(quant_type, device=device) |
| 75 | return _code_4bit_cache[key] |
| 76 | |
| 77 | |
| 78 | def get_gaudi_sw_version(): |
no test coverage detected