Top "Torch" questions

Torch is a scientific computing framework for LuaJIT.

How to convert a list or numpy array to a 1d torch tensor?

I have a list (or, a numpy array) of float values. I want to create a 1d torch tensor that …

torch pytorch
PyTorch : error message "torch has no [...] member"

Good evening, I have just installed PyTorch 0.4.0 and I'm trying to carry out the first tutorial "What is PyTorch?" I …

torch pytorch
Pytorch, what are the gradient arguments

I am reading through the documentation of PyTorch and found an example where they write gradients = torch.FloatTensor([0.1, 1.0, 0.0001]) y.backward(…

neural-network gradient pytorch torch gradient-descent
Torch / Lua, how to select a subset of an array or tensor?

I'm working on Torch/Lua and have an array dataset of 10 elements. dataset = {11,12,13,14,15,16,17,18,19,20} If I write dataset[1], I can read …

arrays lua torch
How to crop image based on binary mask

I am using torch with some semantic segmentation algorithms to produce a binary mask of the segmented images. I would …

image opencv image-processing torch
Pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAType instead

I am trying to re-execute a GitHub project on my computer for recommendation using embedding, the goal is to first …

python-3.x pytorch torch embedding
Torch / Lua after installation is not working

I have followed the following approach in order to install Torch in my machine (Mac). http://torch.ch/docs/getting-started.…

macos lua torch
In Colaboratory, CUDA cannot be used for the torch

The error message is as follows: RuntimeError Traceback (most recent call last) <ipython-input-24-06e96beb03a5> in &…

pytorch google-colaboratory torch
what's the difference between torch.Tensor() vs torch.empty() in pytorch?

I have tried it out as below. It seems to me they're the same. What's the difference between torch.Tensor() …

python pytorch torch tensor
Loading Torch7 trained models (.t7) in PyTorch

I am using Torch7 library for implementing neural networks. Mostly, I rely on pre-trained models. In Lua I use torch.…

python lua pytorch torch pre-trained-model