Questions tagged [tensor]
A tensor is a multi-dimensional array. It is a key entity in many computational libraries, such as tensorflow, torch, theano, caffe, mxnet, used for machine learning tasks. If you use this tag, also tag the question with the corresponding library.
tensor
2,907
questions
0
votes
0
answers
12
views
Set torch.nn.Parameter's data, including the gradient
I have an existing nn.Parameter, and a tensor with a gradient. I want to set the tensor to the parameter in a way that the parameter will have the same gradient (including perhaps .grad_fn and so on). ...
0
votes
1
answer
24
views
How to convert a set of tensor values to a list while keeping the format float precision
I have a 3 lists of ids (sequence[i].id_column) and when I print them, I see (I don't know for what reason) the format of the second list changes! for example 4.2 becomes 4.2e+00. I tried to add all ...
0
votes
0
answers
18
views
Accesing python lists inside TensorFlow graph-traceable functions
I'm trying to access a python list inside a function that can be run in eager mode or graph mode as shown below:
import tensorflow as tf
import numpy as np
class SlotGenerator:
def __init__(self):
...
0
votes
1
answer
23
views
Difference between the expected input tensor order for LSTM and Conv1d?
I am working with time series data and have noticed a discrepancy in the input tensor order required for LSTM and Conv1d/BatchNorm1d/Dropout1d layers in PyTorch. For example, say I have an input ...
0
votes
1
answer
28
views
How to check if some tensor values are in a set of tensor values
I have a list of tensors and I want to check if any of the values within that list is not in a set containing tensor values, here is what I have tried but I see this code finds all the values are not ...
0
votes
0
answers
31
views
How to make PyTorch tensor not to change its input format
I have a list of float values like the following which are ids in my data and in the dataset they are originally like 11.0,11.2,16.2,… but when I try to put them in a Data object like the following:
...
0
votes
0
answers
56
views
Calculating and assigning Christoffel symbols to variables with python
I like to calculate the Christoffel symbols from a given line element and assign the expressions of each of Christoffel symbols to the variables in a user-defined function.
I am using the Python ...
1
vote
2
answers
45
views
Why floating point of a tensors still fluctuates even after using set_printoptions(precision=1)
I followed a tutorial that shows how to do tensors operations in a correct way. They said that usually the operations between tensors are done manually via loops of iterating through the tensor array. ...
0
votes
0
answers
45
views
"Sizes of tensors must match" error in Meta-Llama-3-8B-Instruct
I'm trying to use the pre-trained Meta-Llama-3-8B-Instruct LLM from Hugging Face for fine tuning on my own data. As a very first step, I'm just trying to interact with the model as is.
My system specs:...
0
votes
0
answers
31
views
Algorithm of tensor SVD
I would like to know the different intuition to design the two algorithms to get 3rd-order tensor SVD:
The first one is for [n1,n2,n3] = size(Y);, after Y = fft(Y,[],3);, apply SVD to the first half ...
1
vote
1
answer
116
views
Comparing performance among custom cuda kernel, cublas and cutensor
I've made the following CUDA tests to compare the performance numbers of (square) matrix multiplication, running on Ubuntu 24.04 with the GPU card Quadro T1000 Mobile of compute capability 7.5 (arch=...
0
votes
0
answers
27
views
'Tensor' object is not callable
I am working on a machine learning project where I need to preprocess my data and prepare it for use with an LSTM model in PyTorch. I have a dataset with a datetime index and a target column called '...
1
vote
0
answers
37
views
Pytorch, Can't find the inplace operation that's preventing my network from calculating gradient
I'm trying to implement Proximal Policy Optimisation with multiple Actor heads: there are multiple actions the agent can perform, so I need one head to chose which action(s) to perform, and then ...
1
vote
0
answers
28
views
dataset of tensors shuffled after applying map or model.predict
I am trying to predict a target image from an input image and then display both the input and prediction. For some reason, test_images seems to be reshuffled in the process so I can't get them to line ...
0
votes
0
answers
14
views
How to define several tensor components in one with Maple?
Is there a way to define tensor components without addressing each component individually? Suppose I define a tensor A[a, mu], where Latin letters are space coordinates and Greek letters are space-...