In this post, we will see how to resolve Torch custom pairwise distance Question: i’m working on big distance matrix (10-80k row ; 3k cols) and i want to get custom pairwise distance on that matrix ; and do it ...

In this post, we will see how to resolve How to fix AttributeError: ‘torch.return_types.max’ object has no attribute ‘eq’ Question: I have read the explanation of torch.max() on the website, but it still doesn’t solve the problem enter image description ...

In this post, we will see how to resolve Cannot create .exe with pyinstaller from .py with torchaudio (CPU): AttributeError: ‘_OpNamespace’ ‘torchaudio’ object has no attribute ‘cuda_version’ Question: I have a .py script that uses torchaudio (without GPU) to process ...

In this post, we will see how to resolve Is there a torch function to derive union of two tensors? Question: There is a function that can be used to derive union of two tensors in numpy, as below: However, ...

In this post, we will see how to resolve Convert torch of 9 channel to image of 3 channel (or 1) to display it Question: I have a tensor composed of 9 channel [9, 224, 224], (which is result of ...

Question: I have two matrices. A with size 160 x 250 and B with size 3200 x 250. I want to get the set intersection of each row of A with each row of B to get a 160 x ...

Question: Pytorch GPU did work for me, but after reinstalling anaconda I got this error: Error loading “caffe2_detectron_ops.dll” (when installing the cpu version) or Error loading “caffe2_detectron_ops_gpu.dll” (when installing the gpu version) This error appears already when importing torch in ...

Question: I got this error when trying to use the AdaptiveAvgPool3D in Pytorch. Below is the error trace File “/scratch/a.bip5/BraTS 2021/./sisa.py”, line 395, in outputs = model(inputs) File “/home/a.bip5/.conda/envs/pix2pix/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1051, in _call_impl return forward_call(*input, **kwargs) File “/home/a.bip5/.conda/envs/pix2pix/lib/python3.9/site-packages/torch/nn/parallel/data_parallel.py”, line 166, ...

Question: I got a tensor of scores (lets’ call it logits_tensor) that has shape: torch.Size([1910, 164, 33]). Taking a look at it, logits_tensor[0][0]: Now, by applying softmax I obtain another tensor with same dimensions that contains probabilities, probs_tensor[0][0]: What I’d ...

Question: There’s a single source (square) matrix L of shape (N, N) and a matrix (vector of vectors) of boolean masks m of shape (K, N) according to which I’d like to extract submatrices from L. I know how to ...