| """Minimal stub for tensorflow to allow static imports in tests and linters. | |
| This does not implement real TensorFlow functionality. | |
| """ | |
| from typing import Any | |
| class Tensor: | |
| def __init__(self, data: Any): | |
| self.data = data | |
| def constant(value: Any): | |
| return Tensor(value) | |
| def device(name: str): | |
| class _ctx: | |
| def __enter__(self): | |
| return None | |
| def __exit__(self, exc_type, exc, tb): | |
| return False | |
| return _ctx() | |