Skip to main content

TensorWeaver

TensorWeaver Logo

🧠 A transparent, debuggable deep learning framework
PyTorch-compatible implementation with full visibility into internals

PyPI version License GitHub stars Documentation


🤔 Ever feel like PyTorch is a black box?

# What's actually happening here? 🤷‍♂️
loss.backward()  # Magic? 
optimizer.step()  # More magic?

You're not alone. Most ML students and engineers use deep learning frameworks without understanding the internals. That's where TensorWeaver comes in.

🎯 What is TensorWeaver?

TensorWeaver is a transparent deep learning framework that reveals exactly how PyTorch works under the hood. Built from scratch in pure Python, it provides complete visibility into automatic differentiation, neural networks, and optimization algorithms.

Think of it as "PyTorch with full transparency" 🔧

🎓 Perfect for:

  • ML Engineers debugging complex gradient issues and understanding framework internals
  • Researchers who need full control over their implementations
  • Software Engineers building custom deep learning solutions
  • Technical Teams who need to understand and modify framework behavior
  • Developers who refuse to accept "black box" solutions

💡 Pro Tip: Use import tensorweaver as torch for seamless PyTorch compatibility!

⚡ Quick Start - See the Magic Yourself

pip install tensorweaver
import tensorweaver as torch  # PyTorch-compatible API!

# Build a neural network (just like PyTorch!)
class SimpleModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = torch.nn.Linear(784, 128)
        self.relu = torch.nn.ReLU()
        self.linear2 = torch.nn.Linear(128, 10)
        
    def forward(self, x):
        x = self.relu(self.linear1(x))
        return self.linear2(x)

model = SimpleModel()

# Train it
loss_fn = torch.nn.MSELoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# The difference? You can see EXACTLY what happens inside! 👀

🚀 Try it live in your browser →

🧠 What You'll Learn

🔬 Deep Learning Internals

  • How automatic differentiation works
  • Backpropagation step-by-step
  • Computational graph construction
  • Gradient computation and flow

🛠️ Framework Design

  • Tensor operations implementation
  • Neural network architecture
  • Optimizer algorithms
  • Model export (ONNX) mechanisms

💎 Why TensorWeaver?

🏭 Production Frameworks 🔬 TensorWeaver
❌ Complex C++ codebase ✅ Pure Python - fully debuggable
❌ Optimized for speed only ✅ Optimized for understanding and modification
❌ "Trust us, it works" ✅ "Here's exactly how it works"
❌ Black box internals ✅ Complete transparency and control

🚀 Key Features

  • 🔍 Transparent Implementation: Every operation is visible, debuggable, and modifiable
  • 🐍 Pure Python: No hidden C++ complexity - full control over the codebase
  • 🎯 PyTorch-Compatible API: Drop-in replacement with complete visibility
  • 🛠️ Engineering Excellence: Clean architecture designed for understanding and extension
  • 🧪 Complete Functionality: Autodiff, neural networks, optimizers, ONNX export
  • 📊 Production Ready: Export trained models to ONNX for deployment

🗺️ Technical Roadmap

🔧 Core Components

  1. Tensor Operations - Fundamental tensor mechanics and operations
  2. Linear Models - Basic neural network implementation
  3. Automatic Differentiation - Gradient computation engine (coming soon)

🏗️ Advanced Architecture

  1. Deep Networks - Multi-layer perceptron and complex architectures
  2. Optimization Algorithms - Advanced training techniques (coming soon)
  3. Model Deployment - ONNX export for production systems

⚡ Performance & Extensions

  1. Custom Operators - Framework extension capabilities (coming soon)
  2. Performance Engineering - Optimization techniques (coming soon)
  3. Hardware Acceleration - GPU computation support (in development)

📝 Note: Some documentation links are still in development. Check our milestones for working examples!

🎯 Quick Examples

🔬 See Automatic Differentiation in Action
import tensorweaver as torch

# Create tensors
x = torch.tensor([2.0])
y = torch.tensor([3.0])

# Forward pass
z = x * y + x**2
print(f"z = {z.data}")  # [10.0]

# Backward pass - see the magic!
z.backward()
print(f"dz/dx = {x.grad}")  # [7.0] = y + 2*x = 3 + 4  
print(f"dz/dy = {y.grad}")  # [2.0] = x
🧠 Build a Neural Network from Scratch
import tensorweaver as torch

class MLP(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = torch.nn.Linear(784, 128)
        self.relu = torch.nn.ReLU()
        self.fc2 = torch.nn.Linear(128, 10)
        
    def forward(self, x):
        x = self.relu(self.fc1(x))
        return self.fc2(x)

# Every operation is transparent!
model = MLP()
print(model)  # See the architecture

🎯 Why Engineers Choose TensorWeaver

Instead of opaque "black box" frameworks, TensorWeaver provides:

  • Full Transparency - Every operation is readable, debuggable Python code
  • Complete Control - Modify any component to fit your specific needs
  • PyTorch Compatibility - Use existing knowledge and code seamlessly
  • Deep Understanding - Know exactly what your model is doing at every step

Join our growing community of engineers who value transparency and control.

🚀 Get Started Now

📦 Installation

# Option 1: Install from PyPI (recommended)
pip install tensorweaver

# Option 2: Install from source (for contributors)
git clone https://github.com/howl-anderson/tensorweaver.git
cd tensorweaver
poetry install

🎯 Quick Start Guide

  1. 📂 Browse Examples - Working implementations and demos
  2. 🚀 Try Online - Browser-based environment
  3. 💬 Community Forum - Technical discussions and support
  4. 📖 Documentation - Complete API reference (expanding)

🤝 Contributing

TensorWeaver thrives on community contributions! Whether you're:

  • 🐛 Reporting bugs
  • 💡 Suggesting features
  • 📖 Improving documentation
  • 🧪 Adding examples
  • 🔧 Writing code

We welcome you! Please open an issue or submit a pull request - contribution guidelines coming soon!

📚 Resources

🏢 Professional Use Cases

TensorWeaver excels in scenarios requiring deep understanding and control:

  • 🔬 Research & Development - Implement novel algorithms with full control
  • 🐛 Debugging Complex Models - Trace gradient flow and identify numerical issues
  • 🏗️ Custom Implementations - Build specialized layers and operators
  • 📊 Production Prototyping - Develop and export models to ONNX for deployment

Need support for your specific use case? Open an issue or join our discussions!

⭐ Why Stars Matter

If TensorWeaver helped you debug, understand, or build better models, please consider starring the repository! It helps other engineers discover this transparent framework.

GitHub stars

📄 License

TensorWeaver is MIT licensed. See LICENSE for details.

🙏 Acknowledgments

  • Inspired by transparent implementations: Micrograd, TinyFlow, and DeZero
  • Thanks to the PyTorch team for the elegant API design
  • Grateful to all contributors and the open-source community

Ready for complete transparency in deep learning?
🚀 Explore TensorWeaver at tensorweaver.ai

Metadata

Release files for tensorweaver 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorweaver 0.1.0
File Size Uploaded
tensorweaver-0.1.0.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for tensorweaver 0.1.0
File Interpreter ABI Platform
tensorweaver-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / tensorweaver-0.1.0.tar.gz

Download URL tensorweaver-0.1.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
dc1dfbf7c99a37e754573d111bdba4c73a7f755af84babab79a3b8c16a0eb5e0
BLAKE2b-256 checksum
How to use checksums
f3c65cbde16c497644a921673b0739be22a75cddd02ce000be988a9bfc6c906e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / tensorweaver-0.1.0-py3-none-any.whl

Download URL tensorweaver-0.1.0-py3-none-any.whl
Size 58.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6627f48faa0dc1d3909c9ecd7e24a4d35e7e06f86765aac12c09a65f27899491
BLAKE2b-256 checksum
How to use checksums
c88d76c445e0c6d79efa0ecdfc1bf0c3284923a45d9d1d756285ea7fe26e0737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page