mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-01 05:37:30 -05:00
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:
@@ -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]
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user