Question: I was recently working with Python and wanted to use another way of finding square roots. For example I wanted to find square root of n with Newton-Raphson approximation. I need to overload the overload the `**` (only when you raise a number to 0.5),o perator as well as `math.sqrt()`, because I have several older projects that could be sped up by doing so and replacing all `math.sqrt()` and `**(0.5)` with another function isn't ideal.

Could this be done in Python?

Is it possible to overload either `**` or `math.sqrt`?

Any helpful links are also much appreciated.

```
def Square_root(n):
    r = n/2
    while(abs(r-(n/r)) > t):
        r = 0.5 * (r + (n/r))
    return r

print(2**(0.5)) ## changes to print(Square_root(2))
print(math.sqrt(2)) ## that also becomes print(Square_root(2))

```

Answer: 
For your question, I think `transforms.ToTensor()` before `transform.Scale((32, 32))` is not right.

In the document of `Scale::__call__(self, img)` already show

> 
> Args: img(PIL.Image): Image to be scaled.
> 
> 
> 

So the input for `Scale` is `PIL.Image` not `Tensor`.

```
transform = transforms.Compose(
[transforms.ToTensor(),
 transforms.Scale((32,32)),
 transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])

```

So you could try the following one:

```
transform = transforms.Compose([transforms.Scale((32,32)),
                                transforms.ToTensor(),
                                transforms.Normalize((0.5, 0.5, 0.5), 
                                                     (0.5, 0.5, 0.5))])

```

You can the script to load your custom dataset at [this gist](https://gist.github.com/xpzouying/8078000043a0713056ba14490a90807b). Click [here](https://raw.githubusercontent.com/xpzouying/animals-classification/master/images/gist1.png) to the result of the script.

I post the full classification in custom images, you could check it at **github.com/xpzouying/animals-classification**
This might be as simple as you not providing the correct path to the "imgs" folder. Are you running your program from the same folder as the "imgs" folder? Try specifying an absolute path to your "imgs" folder and see if it helps.