Skip to content

Commit 41734f8

Browse files
committed
tweak
1 parent 852873d commit 41734f8

File tree

2 files changed

+1698
-1508
lines changed

2 files changed

+1698
-1508
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tensor Sensor
22

3-
<img src="https://explained.ai/tensor-sensor/images/teaser.png" width="40%" align="right">One of the biggest challenges when writing code to implement deep learning networks, particularly for us newbies, is getting all of the tensor (matrix and vector) dimensions to line up properly. It's really easy to lose track of tensor dimensionality in complicated expressions involving multiple tensors and tensor operations. Even when just feeding data into predefined [Tensorflow](https://www.tensorflow.org/) network layers, we still need to get the dimensions right. When you ask for improper computations, you're going to run into some less than helpful exception messages. To help myself and other programmers debug tensor code, I built this library. TensorSensor clarifies exceptions by augmenting messages and visualizing Python code to indicate the shape of tensor variables (see figure to the right for a teaser). It works with [Tensorflow](https://www.tensorflow.org/), [PyTorch](https://pytorch.org/), and [Numpy](https://numpy.org/), as well as higher-level libraries like [Keras](https://keras.io/) and [fastai](https://www.fast.ai/).
3+
<img src="https://explained.ai/tensor-sensor/images/teaser.png" width="50%" align="right">One of the biggest challenges when writing code to implement deep learning networks, particularly for us newbies, is getting all of the tensor (matrix and vector) dimensions to line up properly. It's really easy to lose track of tensor dimensionality in complicated expressions involving multiple tensors and tensor operations. Even when just feeding data into predefined [Tensorflow](https://www.tensorflow.org/) network layers, we still need to get the dimensions right. When you ask for improper computations, you're going to run into some less than helpful exception messages. To help myself and other programmers debug tensor code, I built this library. TensorSensor clarifies exceptions by augmenting messages and visualizing Python code to indicate the shape of tensor variables (see figure to the right for a teaser). It works with [Tensorflow](https://www.tensorflow.org/), [PyTorch](https://pytorch.org/), and [Numpy](https://numpy.org/), as well as higher-level libraries like [Keras](https://keras.io/) and [fastai](https://www.fast.ai/).
44

55
*TensorSensor is currently at 0.1b1 so I'm happy to receive issues created at this repo or direct email*.
66

@@ -23,11 +23,15 @@ Displays this in a jupyter notebook or separate window:
2323

2424
Instead of the following default exception message:
2525

26-
<font bgcolor="#FEE4E5">RuntimeError: size mismatch, m1: [764 x 100], m2: [764 x 200] at /tmp/pip-req-build-as628lz5/aten/src/TH/generic/THTensorMath.cpp:41</font>
26+
```
27+
RuntimeError: size mismatch, m1: [764 x 100], m2: [764 x 200] at /tmp/pip-req-build-as628lz5/aten/src/TH/generic/THTensorMath.cpp:41
28+
```
2729

28-
TensorSensor augmented with:
30+
TensorSensor augments the message with more information about which operator caused the problem and includes the shape of the operands:
2931

30-
<font bgcolor="#FEE4E5">Cause: @ on tensor operand W w/shape [764, 100] and operand X.T w/shape [764, 200]</font>
32+
```
33+
Cause: @ on tensor operand W w/shape [764, 100] and operand X.T w/shape [764, 200]
34+
```
3135

3236

3337
## Install

0 commit comments

Comments
 (0)