Top "Pytorch" questions

PyTorch is a deep learning framework that implements a dynamic computational graph, which allows you to change the way your neural network behaves on the fly and capable of performing backward automatic differentiation.

What does model.train() do in PyTorch?

Does it call forward() in nn.Module? I thought when we call the model, forward method is being used. Why …

python pytorch
Embedding in pytorch

I have checked the PyTorch tutorial and questions similar to this one on Stackoverflow. I get confused; does the embedding …

pytorch word-embedding
Convert PyTorch tensor to python list

How do I convert a PyTorch Tensor into a python list? My current use case is to convert a tensor …

python pytorch
How Pytorch Tensor get the index of specific value

In python list, we can use list.index(somevalue). How can pytorch do this? For example: a=[1,2,3] print(a.index(2)) …

python pytorch
Understanding torch.nn.Parameter

I am new to pytorch and I have difficulty in understanding how torch.nn.Parameter() works. I have gone through …

python pytorch
How do I flatten a tensor in pytorch?

Given a tensor of multiple dimensions, how do I flatten it so that it has a single dimension? Eg: >&…

pytorch
How to get mini-batches in pytorch in a clean and efficient way?

I was trying to do a simple thing which was train a linear model with Stochastic Gradient Descent (SGD) using …

python numpy machine-learning deep-learning pytorch
Convert Pandas dataframe to PyTorch tensor?

I want to train a simple neural network on PyTorch using a personal database. This database is imported from an …

python pandas dataframe pytorch
What's the difference between reshape and view in pytorch?

In numpy, we use ndarray.reshape() for reshaping an array. I noticed that in pytorch, people use torch.view(...) for …

pytorch
Using CUDA with pytorch?

I have searched on here but I found only outdated posts. I want to run the training on my GPU. …

pytorch torch