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,908
questions
1
vote
0
answers
39
views
Julia - Reduce allocation in nested for loops
I have a function that calculates the expectation and covariance of random variables on a grid with dimensions (nx, ny, nz). The variables y and z are Markovian, with Qy and Qz being their Markov ...
-1
votes
1
answer
34
views
'tuple' object has no attribute 'rank'
This is a FabricNet sample implementation (official code). As it was in the research paper, the input image size is 120x120x3. I tried the below code, but it throws the error 'tuple' object has no ...
0
votes
0
answers
15
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
28
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
20
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
26
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
30
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
32
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
59
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
55
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
49
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
33
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
132
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
29
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
41
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 ...