HeyTensor

Free browser-based PyTorch tensor shape calculator with 22 tools. Computes shapes through Conv, Linear, LSTM, and Transformer layers without running code. Includes architecture presets (LeNet, ResNet block, Transformer encoder) and a "paste error" mode for parsing PyTorch RuntimeErrors.

Last verified:

Visit HeyTensor

What is HeyTensor?

HeyTensor is a free, browser-based tensor shape calculator built for deep learning practitioners who need to quickly determine output dimensions for neural network layers. Instead of manually applying formulas or inserting print statements into code, users enter the input shape and layer parameters, and HeyTensor computes the exact output shape instantly. The calculator supports 14 layer types across both PyTorch and TensorFlow including Conv2d, Conv1d, Linear, LSTM, GRU, MultiheadAttention, BatchNorm, MaxPool2d, AvgPool2d, Flatten, Reshape, Dropout, Transpose, and Concatenate.

The most powerful feature is Chain Mode, which lets users stack layers sequentially and see the output shape at every step of their network. If shapes become incompatible between layers—the most common source of PyTorch RuntimeErrors—the mismatch is highlighted immediately. This lets users fix architecture issues before writing any code. The Paste Error mode goes further: paste a PyTorch error message like

HeyTensor pricing

Pricing model: Freemium

HeyTensor is completely free. All tools are free, run in your browser, and require no signup. There are no paid plans, no premium tiers, and no subscription fees. All calculations run entirely in the browser with no data sent to any server. The source code is open on GitHub.

HeyTensor pros

  • Completely free with no paid plans or subscriptions
  • Runs entirely in browser—no data sent to any server
  • No signup or account required to use any tool
  • Supports 14 different layer types across PyTorch and TensorFlow
  • Chain Mode shows output shape at every layer step
  • Paste Error mode parses PyTorch RuntimeErrors and suggests fixes
  • Architecture presets include LeNet-5, ResNet block, Transformer encoder, LSTM classifier
  • Highlights shape mismatches immediately before running code
  • Shows detailed formulas for how each output dimension is calculated
  • Single-layer calculator for instant shape computation
  • Open source with code available on GitHub
  • No cookies, no analytics, no tracking of any kind
  • Works with both PyTorch and TensorFlow layer naming
  • Includes error debuggers for CUDA Out of Memory and shape mismatch errors
  • Built specifically for deep learning practitioners and ML engineers

HeyTensor cons

  • Only calculates tensor shapes—does not train or run models
  • Limited to 14 specific layer types
  • No mobile app available, browser-only
  • No saved projects or history feature
  • No collaboration or sharing features for architectures
  • Does not support custom layer definitions
  • No visualization of network architecture beyond shapes
  • No GPU acceleration since everything runs in browser

Frequently asked questions about HeyTensor

How do I calculate Conv2d output shape?

The Conv2d output shape formula is: H_out = floor((H_in + 2padding - dilation(kernel_size-1) - 1) / stride) + 1. The same formula applies to width. For example, with input (1, 3, 224, 224), kernel_size=3, padding=1, stride=1: output height = floor((224 + 2 - 3) / 1) + 1 = 224. Use the calculator to compute this instantly for any configuration.

Why does PyTorch say mat1 and mat2 shapes cannot be multiplied?

This error means the number of columns in the first matrix doesn't match the number of rows in the second. In PyTorch, this usually happens when a Linear layer's in_features doesn't match the actual input size. For example, if your flatten produces 512 features but Linear expects 256, you'll see this error. Fix: set in_features to match your actual flattened size, or use Chain Mode to trace shapes through your network.

What is the output shape of a Linear layer?

A PyTorch nn.Linear(in_features, out_features) layer transforms the last dimension of the input tensor. If input is [batch, features], output is [batch, out_features]. If input is [batch, seq, features], output is [batch, seq, out_features]. Only the last dimension changes to out_features.

How do I fix tensor size mismatch in PyTorch?

Tensor size mismatches happen when two tensors in an operation have incompatible shapes. Steps to fix: 1) Print tensor shapes with tensor.shape at each layer. 2) Use Chain Mode to trace shapes through your network. 3) Common fixes include adjusting padding in Conv layers, changing in_features in Linear layers, or adding a Flatten layer before fully connected layers.

What does RuntimeError: Expected input batch_size mean?

This error means your input tensor and target tensor have different batch sizes. For example, if your model outputs predictions for 32 samples but your labels only have 16 entries. Fix: ensure your data loader returns matching batch sizes for inputs and targets. Check for accidental reshaping that changes the batch dimension.

Does HeyTensor support TensorFlow layers?

Yes. While the layer naming follows PyTorch conventions, the shape formulas are identical across frameworks. Conv2D, Dense (Linear), LSTM, and pooling layers use the same mathematical formulas in both PyTorch and TensorFlow. Enter your TensorFlow layer parameters and the output shapes will be correct.

Is HeyTensor free to use?

Yes. All HeyTensor tools are free, run in your browser, and require no signup. There are no paid plans or premium features. All calculations run entirely in your browser—no data is sent to any server. The source code is open on GitHub.

What layer types does HeyTensor support?

HeyTensor supports 14 layer types: Conv2d, Conv1d, Linear, LSTM, GRU, MultiheadAttention, BatchNorm, MaxPool2d, AvgPool2d, Flatten, Reshape, Dropout, Transpose, and Concatenate. These cover the most common layers used in PyTorch and TensorFlow deep learning models.

What is Chain Mode in HeyTensor?

Chain Mode lets you stack layers sequentially and see the output shape at every step of your network. If shapes become incompatible between layers—the most common source of PyTorch RuntimeErrors—the mismatch is highlighted immediately. This lets you fix architecture issues before writing any code, saving the frustrating cycle of running a training script, hitting a shape error, guessing the fix, and running again.

Who built HeyTensor?

HeyTensor is built and maintained by Michael Lip. He also builds BeLikeNative (a Chrome writing assistant) and 20+ tools under Zovo. For questions or feedback, you can email [email protected] or visit the project on GitHub.

Categories

Use cases

Browse all AI tools on NeedAnAI