Top "Tensor" questions

A tensor is a multi-dimensional array.

Torch: How to shuffle a tensor by it's rows?

I am currently working in torch to implement a random shuffle (on the rows, the first dimension in this case) …

lua permutation lua-table torch tensor
Dot product along third axis

I'm trying to take a tensor dot product in numpy using tensordot, but I'm not sure how I should reshape …

python numpy tensor dot-product
Understanding PyTorch einsum

I'm familiar with how einsum works in NumPy. A similar functionality is also offered by PyTorch: torch.einsum(). What are …

python numpy pytorch tensor numpy-einsum
What is the alternative of numpy.newaxis in tensorflow?

Hi I am new to tensorflow. I want to implement the following python code in tensorflow. import numpy as np …

python python-3.x numpy tensorflow tensor
How to multiply Keras tensor by scalar?

if I have tensors, v, w, I know you can multiply them together with a = Multiply()([v, w]) But what …

keras tensor
Porting PyTorch code from CPU to GPU

Following the tutorial from https://github.com/spro/practical-pytorch/blob/master/seq2seq-translation/seq2seq-translation.ipynb There is a USE_…

python torch pytorch tensor
What does layout = torch.strided mean?

As I was going through pytorch documentation I came across a term layout = torch.strided in many of the functions. …

python multidimensional-array pytorch tensor numpy-ndarray
How does Pytorch Dataloader handle variable size data?

I have a dataset that looks like below. That is the first item is the user id followed by the …

python pytorch tensor variable-length
Drop a dimension of a tensor in Tensorflow

I have a tensor that have shape (50, 100, 1, 512) and i want to reshape it or drop the third dimension so that …

python tensorflow slice tensor
RuntimeError: "exp" not implemented for 'torch.LongTensor'

I am following this tutorial: http://nlp.seas.harvard.edu/2018/04/03/attention.html to implement the Transformer model from the "Attention …

pytorch tensor attention-model