# How to experiment on test\_torch.py?

**URL:** <https://discuss.pytorch.org/t/how-to-experiment-on-test-torch-py/1210>\
**Category:** Uncategorized\
**Created:** [March 20, 2017, 3:43pm UTC](https://discuss.pytorch.org/t/how-to-experiment-on-test-torch-py/1210 "2017-03-20T15:43:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dl4daniel](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@dl4daniel](https://discuss.pytorch.org/u/dl4daniel)\
**Post date:** [March 20, 2017, 3:43pm UTC](https://discuss.pytorch.org/t/how-to-experiment-on-test-torch-py/1210/1 "2017-03-20T15:43:37Z")

</div>

Hi Everyone,

@Veril @apaszke

I am new to pytorch, and I would like to learn more of tensor operations by experimenting the `test_torch.py` file, since it got lots of examples inside.

Basically, I want to run each test\_function on each tensor operation individually, so I can see how the operation work.

How I tried, but failed:

```python
# inside jupyter notebook
%cd /path to /pytorch-master/test

import torch
import test_torch
test1 = test_torch.TestTorch(methodName='runTest')
test1.test_dot()

```

However, there is no error, nor return anything at all. Then I went to `test_torch.py` and added two `print` to `test_dot()` function as below, but nothing showed.

```auto
def test_dot(self):
        types = {
            'torch.DoubleTensor': 1e-8,
            'torch.FloatTensor': 1e-4,
        }
        for tname, prec in types.items():
            v1 = torch.randn(100).type(tname)
            v2 = torch.randn(100).type(tname)
            res1 = torch.dot(v1, v2)
            print(res1)
            res2 = 0
            for i, j in zip(v1, v2):
                res2 += i * j
            print(res2)
            self.assertEqual(res1, res2)

```

Could anyone help me find a way to experiment on each test function individually?

Thanks a lot!

Daniel
