Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
52 views

After converting module A to CPU, the origin parameter tensor still stays on the GPU? When it is released? Is it wrong if I reuse the parameter? My code: import torch.nn as nn class A(nn.Module): ...
jiwei zhang's user avatar
0 votes
0 answers
24 views

Using einsteinpy package of Python, I am defining the electromagnetic tensor (or any other arbitrary tensor). While defining, I am defining it as 'uu' tensor using the BaseRelativityTensor class file. ...
ASarkar's user avatar
  • 559
1 vote
1 answer
283 views

I am writing PTX assembly code on CUDA C++ for research. This is my setup: I have just downloaded the latest CUDA C++ toolkit (13.0) yesterday on WSL linux. The local compilation environment does not ...
Junhao Liu's user avatar
0 votes
1 answer
33 views

When I run: from transformers import AutoProcessor, BarkModel import os from scipy.io.wavfile import write as write_wav CUDA_VISIBLE_DEVICES=0 os.environ["SUNO_OFFLOAD_CPU"] = "True&...
rocky's user avatar
  • 1
1 vote
0 answers
40 views

I have a model that given a configuration, or state (of a Rubik's cube, but whatever, it is a sequence of integers) generates a movement (from 0 to 5). This movement can be used to bring the ...
Nikio's user avatar
  • 111
0 votes
1 answer
37 views

Why TensorDataset devide the data to minibatches? For example, when putting in it 2D array, instead of yielding 2D tensors as batches, it sets the required batches to be minibatches, and its actual &...
J. Doe's user avatar
  • 305
1 vote
0 answers
41 views

My code involves slicing large tensors on the CPU by index and asynchronously transmitting them back to the GPU. However, through the Profiler debugging tool, I found that this step would seriously ...
Ponytail's user avatar
0 votes
1 answer
71 views

I have a padded tensor X with shape (B, T1, C) and a padded tensor Y with shape (B, T2, C), I also know the sample lengths L for X. I want to insert the samples of X into Y at certain index I and pad ...
junhuizh's user avatar
  • 412
1 vote
0 answers
42 views

I am facing an issue with multiprocessing. I am trying to load my .pt data as dataloaders. Everything works fine when I set the num_workers = 0. But when I set it to a value greater than 0, the tensor ...
jobayer's user avatar
  • 11
1 vote
2 answers
174 views

In my PyTorch implementation of multi-head attention, i have those in __init__() class MultiHeadAttentionLayer(nn.Module): def __init__(self,d_in,d_out,context_length,dropout,num_heads,use_bias=...
Yilmaz's user avatar
  • 51k
0 votes
1 answer
84 views

I can't understand if torch.scatter or torch.gather could be used to reduce values of a tensor according to a reduction function over specified indices. I've frequently used the torch_geometric.nn....
daqh's user avatar
  • 146
1 vote
1 answer
54 views

Let's say we have an ordered 1D tensor of ints/longs t. I want to produce a new tensor a with size max(t) where each term a[i] contains the first occurrence of the value i in the tensor t. We could ...
daqh's user avatar
  • 146
-1 votes
1 answer
273 views

i am trying to run newly announced model: Phi-4-mini-instruct https://huggingface.co/microsoft/Phi-4-mini-instruct It has example, I tried it on Google Colab T4 Notebook, but here is what I got import ...
최영진's user avatar
3 votes
1 answer
53 views

I get a very weird behavior for a 'smaller' operation on a float torch tensor. Consider the following snippet t = torch.load(r"value.pt")
 print(t.shape, t.dtype)
 #t = t.double() for i in ...
user2224350's user avatar
  • 2,326
2 votes
1 answer
99 views

I'm stuck with a Pytorch problem and could use some help: I've got two tensors: A 3D tensor (shape: i, j, j) with integer values from 0 to n A 1D tensor (shape: n) I need to create a new tensor that'...
Raphael's user avatar
  • 128
1 vote
1 answer
59 views

I created this plot using tensor smooths.. I would like to add a visualization of the data density along the x-axis and z-axis. Ideally, this could be done with either: A rug plot on the respective ...
Fabian.m's user avatar
0 votes
1 answer
51 views

I'm beginner in image processing. I have two binary classes as subdirectory which total of 496 images and I have an issue with the last batch that has remainder of 13 images. So, instead of tf.dataset ...
CChickii's user avatar
2 votes
2 answers
61 views

I have the following training code. I am quite sure I call loss.backward() just once, and yet I am getting the error from the title. What am I doing wrong? Note that the X_train_tensor is output from ...
Baron Yugovich's user avatar
0 votes
1 answer
137 views

I am following an online course and running the following code in python 3.11 to build a CNN for image classification using Keras 3.6 and TensorFlow 2.18: # Convolutional Nueral Network import ...
katmatzidis's user avatar
0 votes
1 answer
59 views

I was going through https://github.com/parrt/fundamentals-of-deep-learning/blob/main/notebooks/3.train-test-diabetes.ipynb as an exercise, but forgot to reshape y tensors in these lines y_train = ...
Baron Yugovich's user avatar
1 vote
0 answers
77 views

I want to do manipulations with big mathematical expressions containing tensors and symbols. For example I have expressions containing the Kronecker delta $δ_{ij}$ and the 3-dimension Levi-Civitta ε_{...
Arbiter's user avatar
  • 111
3 votes
1 answer
125 views

I get error if I don't supply retain_graph=True in y1.backward() import torch x = torch.tensor([2.0], requires_grad=True) y = torch.tensor([3.0], requires_grad=True) f = x+y z = 2*f ...
pasternak's user avatar
  • 403
1 vote
1 answer
523 views

error message: Traceback (most recent call last): File "/home/prakrisht/-------------/detect_from_webcam.py", line 173, in <module> run_inference(detection_model, category_index, ...
Beetran Dahiya's user avatar
1 vote
1 answer
1k views

In my cuda program, I use many tensor cores operations like m8n8k4 and even use cusparseSpMV. However, when checking the ncu report, it shows like this: There is no active tensors in my program. The ...
Severus Snape's user avatar
0 votes
1 answer
90 views

The official documentation of numpy.linalg.tensorsolve does not really say much about what the function does. Is there any other description available in addition to the source code? A description ...
Arrigo's user avatar
  • 259

1
2 3 4 5
59