refactor: Standardize imports across modules 10-17 to match 01-09

Enforce consistent import pattern across all modules:
- Direct imports from tinytorch.core.* (no fallbacks)
- Remove all sys.path.append manipulations
- Remove try/except import fallbacks
- Remove mock/dummy class fallbacks

Fixed modules:
- Module 10 (tokenization): Removed try/except fallback
- Module 12 (attention): Removed sys.path.append for tensor/layers
- Module 15 (profiling): Removed sys.path + mock Tensor/Linear/Conv2d
- Module 16 (acceleration): Removed hardcoded path + importlib + mock Tensor
- Module 17 (quantization): Removed sys.path + disabled fallback block

All modules now follow the same pattern as modules 01-09:
  from tinytorch.core.tensor import Tensor
  from tinytorch.core.layers import Linear
  # etc.

No development fallbacks - assume tinytorch package is installed.
This commit is contained in:
Vijay Janapa Reddi
2025-10-24 10:36:48 -04:00
parent 191f6db7c7
commit 0e997e4a10
5 changed files with 8 additions and 122 deletions

View File

@@ -69,10 +69,7 @@ import re
from collections import defaultdict, Counter
# Import only Module 01 (Tensor) - this module has minimal dependencies
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '01_tensor'))
from tensor_dev import Tensor
from tinytorch.core.tensor import Tensor
# %% [markdown]
"""