Skip to content

Tag: python

What does .view() do in PyTorch?

What does .view() do to a tensor x? What do negative values mean? Answer view() reshapes the tensor without copying memory, similar to numpy’s reshape(). Given a tensor a with 16 elements: To reshape this tensor to make it a 4 x 4 tensor, use: Now a will be a 4 x 4 tensor. Note that after the reshape th…

ModuleNotFoundError: No module named ‘forms’

New to django, I am trying to understand this error. The forms is in the folder of the project. My forms.py is importing from django forms. My views.py is importing LoginForm I don’t know why I am getting this error? Thanks Answer It sounds like it should be working, you might want to post the full erro…

Replacing ‘x..’ litteral string in Python

I have directories that contains ‘x..’ characters such as ‘x00’ : and I want to rename them without these, since when I copy those files to windows they become unusable. So my python script is going through those directories and detecting the problematic characters the following way: F…

Python 3.6 install win32api?

This question’s answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. Is there a way to install the win32api module for python 3.6 or do I have to change my version of python? Everytime I try to install it using pip I get t…