mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-29 20:40:57 -05:00
STANDARDIZE: Consistent Linear terminology across all modules
Remove backward compatibility aliases and enforce PyTorch-consistent naming: - Remove Dense = Linear alias in Module 04 (layers) - Update all Dense references to Linear in Modules 02, 08, 09, 18, 21 - Remove MaxPool2d = MaxPool2D alias in Module 17 (quantization) - Standardize fc/dense_weights to linear_weights in Module 18 (compression) Benefits: - Eliminates naming confusion between Dense/Linear terminology - Aligns with PyTorch production patterns (nn.Linear) - Reduces cognitive load with single consistent naming convention - Improves student transfer to real ML frameworks All modules tested and functionality preserved.
This commit is contained in:
@@ -63,7 +63,6 @@ from typing import Union, List, Optional, Tuple, Dict, Any
|
||||
try:
|
||||
from tinytorch.core.tensor import Tensor
|
||||
from tinytorch.core.spatial import Conv2d, MaxPool2D
|
||||
MaxPool2d = MaxPool2D # Alias for consistent naming
|
||||
except ImportError:
|
||||
# For development, import from local modules
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '02_tensor'))
|
||||
@@ -71,7 +70,6 @@ except ImportError:
|
||||
try:
|
||||
from tensor_dev import Tensor
|
||||
from spatial_dev import Conv2d, MaxPool2D
|
||||
MaxPool2d = MaxPool2D # Alias for consistent naming
|
||||
except ImportError:
|
||||
# Create minimal mock classes if not available
|
||||
class Tensor:
|
||||
|
||||
Reference in New Issue
Block a user