Skip to content

Tag: pytorch

reorder columns in a tensor according to a dictionary

I don’t know how to explain it correctly, so the title might be misleading. What I want to do is to move columns from a 3d tensor t1 to another 3d tensor t2 according to the indices. There’s a dictionary td, and a (k,v) pair in td means that kth column of t1 will be the vth column of t2

pytorch cuda out of memory while inferencing

I think this is a very basic question, my apologies as I am very new to pytorch. I am trying to find if an image is manipulated or not using MantraNet. After running 2-3 inferences I get the CUDA out of memory, then after restarting the kernel also I keep getting the same error: The error is given below: Runt…

Creating and Use a PyTorch DataLoader

I am trying to create a PyTorch Dataset and DataLoader object using a sample data. This is the tab seperated dataset: This is the code to create the Dataset above and DataLoader object: The code is simply saved with the filename “demo.py”. The code should succesfully execute once the command &#821…