Skip checks for the `transformers` cache class when performing AutoTP tensor comparisons.
(obj)
| 1263 | |
| 1264 | |
| 1265 | def is_transformers_cache(obj): |
| 1266 | """Skip checks for the `transformers` cache class when performing AutoTP tensor comparisons.""" |
| 1267 | try: |
| 1268 | from transformers.cache_utils import Cache |
| 1269 | except ImportError: |
| 1270 | return False |
| 1271 | |
| 1272 | return isinstance(obj, Cache) |
| 1273 | |
| 1274 | |
| 1275 | def compare_tensors_in_structures(inputs1: Union[List, Dict], inputs2: Union[List, Dict]) -> bool: |
no outgoing calls
no test coverage detected