user_q stringlengths 3 20 | question stringlengths 20 31k | user_a stringclasses 5
values | answer stringlengths 18 302 |
|---|---|---|---|
ky_Pa | Hi,I encounter the problem when I try to modify the code.I did not find the indentation problem after checking, so does the problem occur in the use of narrow?I’m thinking of changing the second division to third division through narrow.Looking forward to your answers. Thanks!s1_output_cla = output_cla.narrow(0, 0, int... | albanD | I think you’re missing a closing parenthesis on the line above this one. It should be:
s2_output_cla = output_cla.narrow(0, int(inputs.size(0)/3), int(inputs.size(0)/3)) |
tmaric | I would like to calculate y = sin(x), where x is a vector of length N and compute the corresponding derivative vector y’ = (dy_i / dx_i), i = 1,2,3,…,N using autograd.This is what I ended up doing:// Input vector x
auto x = torch::linspace(
0, M_PI, 100, torch::requires_grad()
);
// sin(x) as a v... | albanD | Hi,
I think the best way to see what happens here is to write the Jacobian of your function and see what happens when you do the vector jacobian product (backward pass).
For your sin function, it just applies the sin element-wise to the input. So the Jacobian matrix is a diagonal matrix with on ea… |
Anakin | Hello all,as doc ofclonefunction showsThis function is differentiable, so gradients will flow back from the result of this operation toinput. To create a tensor without an autograd relationship toinputseedetach().for instance,src = torch.rand(3, 5, requires_grad =True)
dst = src.clone()The gradients that related todstt... | albanD | Hi,
What .clone() does is allocate brand new memory and copy the content of the Tensor into it. It always creates a new contiguous Tensor as output.
The thing with expand is that it does not actually allocate new memory but play with stride. Unfortunately, not all functions support non-standard st… |
learner47 | I was going through the activation functionHardtanh. The definition involves clipping (or clamping) the values between1and-1. How does Torch threshold the values for this operation while still remaining differentiable? | albanD | Yes.
Just like when you have relu with a negative input. It is constant in that region and will return a 0 gradient. |
Jiajun_Zha | Every time before the forward() function of an nn.Module is called, I want to check and probably modify this nn.Module’s parameter, including weight and bias.But the official source code of “register_forward_pre_hook” below doesn’t really say if this is achievable.def register_forward_pre_hook(self, hook):
r"""... | albanD | Hi,
Yes, you can modify the Module in any way you want during that hook (the module is the first arg of the hook function).
Note though that if you swap out weight Tensors, it might not behavior properly with other elements that were tracking the old Tensors like optimizers. |
Jiajun_Zha | Below is the source code of _register_state_dict_hook I quoted from official Pytorch nn.Moduledef _register_state_dict_hook(self, hook):
r"""These hooks will be called with arguments: `self`, `state_dict`,
`prefix`, `local_metadata`, after the `state_dict` of `self` is set.
Note that only parame... | albanD | Hi,
This is linked to when the load_state_dict() function is called.
Note that this function is internal and might change without notice in the future. |
Naman-ntc | Suppose I have a customnn.Module–class Identity(nn.Module):
def __init__(self):
pass
def forward(x):
return x
hooked_layer = Identity()
hookfn = lambda model,input,output: output*2
### hookfn can in principle be complex function
### even non differentiable such as quantization
hooked_laye... | albanD | Hi,
I think the simplest way to understand what will happen here is to know that the autograd lives below torch.nn and is completely unaware of what torch.nn does.
So in this case, whatever is the Tensor you give to the rest of the net is the one that will get gradients (it does not matter if it c… |
lucastononrodrigues | I was implementing a torch.qr inside a module of my creation with something like this:self.q_transposed=torch.qr(nn.Parameter(torch.randn(self.m,self.n),requires_grad=False).T)[0].TEven though the module device is cuda (I made sure of that), the parameter is in cpu for some reason.The same thing is happening with torch... | albanD | Hi,
Yes all of the factory functions like randn or ones are independent of the nn.Module device.
So in general, you want to provide a device= argument to these functions if you want the Tensor to be created on a special device.
You can get the right device from any param or input of your Module.
… |
spring | If dropout is applied during training, I know that dropout rate should be set to 0 through model.eval() when evaluating. Then, are the droppedout weights given random values when evaluated? If so, I think the performance will be worse. Can’t we keep dropout even when we evaluate? | albanD | Hi,
Since dropout is random every time it is used, there are not a fixed set of weights that are droppedout. They are all used sometimes during training and so have been trained properly. |
mk100000 | Hi,When calling thebackward()method, is it possible to apply gradient flow information to multiple leaves? It seems like autograd likes to register the necessary updates to the optimizer of asingleleaf node along the computation graph.The following code summarizes what I want (outputs the correct updates afteroptimizer... | albanD | Yes you can use .detach() to get a new Tensor that does not share the gradient history with the original Tensor.
Or if you want to do an op that should not be tracked by autograd (like a copy) you can do:
with torch.no_grad():
params2.copy_(out)
In your case, I think you can generate the grad… |
tsoj | I have this (to the best of my knowledge) minimal example that segfaults when using a data_loader if I use from_blob to create a tensor for my custom dataset but it works fine if I just use something like torch::empty:#include <iostream>
#include <torch/torch.h>
#include <vector>
#define USE_FROM_BLOB
struct MyDatase... | albanD | Hi,
When you call from_blob, you tell the Tensor to use this content in memory but the Tensor does not “own” the memory!
So it is your responsability to make sure that this memory is kept allocated as long as the Tensor lives.
In your case, when you exit the scope, the std::vector is destructed a… |
Adamya_Shyam | I have a code in which following line is written but when I ran it, some warnings occurred quoting use no_grad.What should I do for this command? Please tell the alternate.def batchrun(image_batch, model):image_batch = torch.FloatTensor(image_batch).cuda()image_batch = torch.autograd.Variable(image_batch, volatile=Tru... | albanD | Hi, you should change it to:
def batchrun(image_batch, model):
image_batch = torch.tensor(image_batch, dtype=torch.float32, device="cuda")
with torch.no_grad():
feats = model(image_batch)
feats = feats.detach().cpu().clone().numpy()
return feats |
Surayuth_Pintawong | I want to create computation graphs for updated parameters so that I could calculate their higher-order derivatives later. The code below shows how I solve the problem if the model is not complex.import torch
# 1: Define model parameters(w, T)
w = torch.tensor(1., requires_grad = True)
T = torch.tensor(2., requires_gr... | albanD | Hi,
You might want to take a look at thehigherlibrary that is built to do just that. |
googlebot | autograd-mix822×303 21.1 KBAm I correct in assuming that adding CPU operations like above makes gradient accumulation (for tensor shared_ctx) non-deterministic?I.e. latent1backward & latent2backward are serialized, as single cuda stream is used. But CPU backward functions (and/or memory transfers) are executed concurre... | albanD | Hi,
Yes you are correct that when using multiple devices, the accumulation is not forced to run in a specific order.
A “simple” solution to fix that is to use a custom function that does the copy to the different devices in the forward and the accumulation in the backward (in a fixed order in your… |
Young_chai_Zheng | I am testing the difference between “expand()” and “repeat()”.There are some problems when executing the backward. I have a little trouble understanding this error message.a = nn.Parameter(torch.FloatTensor(torch.ones(3,1)), requires_grad=True)
b = a.expand(3,4)
c = a.repeat(1,4)
print(a.data_ptr(),b.data_ptr(),c.data_... | albanD | Hi,
Some precisions to Alexey’s message:
Indeed, the problem is not with only expand, but with expand + the inplace. And in particular because expand is a view of a. This is why you don’t see any issue if you remove the inplace or if you replace the expand with a repeat that is not a view (it a… |
Bruce_zhuang | I am trying to get the PyTorch to work without preserving its computation graph at the background, to save GPU memory. My code is roughly as follows:with torch.no_grad():train_X, labels = Variable(train_X, requires_grad=False).to(device), Variable(labels, requires_grad=False).to(device)conv0 = nn.Conv2d(in_channels=3, ... | albanD | Hi,
To prevent the autograd from saving anything, setting with torch.no_grad(): is enough.
The other issue you might have is about how you measure GPU memory as pytorch use a custom allocator and so memory reported by the OS is not necessarily correct.
Also when you do out = relu(out), the relu i… |
ratishsp | Hi,The output for torch.Tensor([0])*torch.Tensor([-1]) is -0[torch.FloatTensor of size 1]Why is it not positive 0?Thanks. | albanD | I would guess floating point standard definition?
In any case, +0 and -0 behave exactly the same, is that a problem for you? |
Sam_Lerman | I haven’t been able to install Pytorch. When I try using pip3, I get this error due to building wheel for Numpy:ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directlyWhen I use the Apple version of NumPy that Tensorflow released, I need to use a virtual env. So I activate that env an... | albanD | Since there is no binary, I guess you can also install it from source the same way.
If you encounter any issues with that, do report an issue on the torchvision repo! |
kolorado | Hi,in theory, these should give the same result, but these two layers produced different (but similar) results:import torch
from torch import nn
b=20
outc = 10
inc = 10
res = 32
input_tensor = torch.randn((b, inc, res, res))
cnn_layer = nn.Conv2d(in_channels=inc, out_channels=outc, kernel_size=res,)
out_cnn_layer = cn... | albanD | Hi,
Running on current colab, this is what I see:
The same thing as you: a difference of ~1e-6 difference for float. But adding torch.set_default_dtype(torch.double) at the beginning, it goes down to ~1e-15.@InnovAruldid you set it properly to double?
So it looks like it is expected loss of pre… |
JiarunLiu | Hi, I’m recently update my pytorch from 1.4.0 to 1.8.0. However, when i running my code without any changes, an error occurs:Traceback (most recent call last):
File "Loss.py", line 768, in <module>
lossB.backward()
File "/Users/opt/anaconda3/envs/torch_18/lib/python3.7/site-packages/torch/tensor.py", line 233, ... | albanD | Hi,
The issue is that old versions of pytorch were not considering the optimizer step as an inplace operation properly. And so this check was not working properly and was not raising an error even though it was computing wrong gradients. This has been fixed in latest master and this error is expect… |
vkubicki | If I create a network (for example using torch.nn.Sequential), then perform a forward pass, where are the values at the nodes stored ? They are needed for the backward operation to retropropagate the gradient of the error. Are they stored somewhere in the network during the forward pass, or does the backward pass first... | albanD | Hi,
These values are not stored at the torch.nn level. They are handled by the autograd directly that stores them along with all the informations needed to perform the backward pass. |
a-parida12 | I have a total of 4 GPUs. I want to use the gpu no. 2 for my experiments. on the top of the code I setos.environ["CUDA_VISIBLE_DEVICES"]='2'but I see that I am still using GPU no. 0.Alsotorch.cuda.device_count()returns 4 to me. How can I fix it? | albanD | Hi,
Two things:
The CUDA_VISIBLE_DEVICES environment variable is read by the cuda driver. So it needs to be set before the cuda driver is initialized. It is best if you make sure it is set before importing torch (or at least before you do anything cuda related in torch).
The device numbers within… |
stefano_d | Hi,I am trying to extend the size of a nn.parameter, but without creating a new one. Is it possible?Here is a simplified code of what I want to do:import torch
w = torch.nn.Parameter(torch.randn((2,5)),requires_grad=True)
l = torch.sum(w)
l.backward()
# if "del l" is added here then the code runs
ext_w = torch.ran... | albanD | In that case you can use set:
import torch
w = torch.nn.Parameter(torch.randn((2,5)),requires_grad=True)
l = torch.sum(w)
l.backward()
# if "del l" is added here then the code runs
ext_w = torch.randn((1,5),requires_grad=True) # now the shape is (3,5)
with torch.no_grad():
w.set_(ext_w)
l… |
cosmosaa | I’m curious what happens in this scenario. If we setrequires_grad = Falseto some parameters, but accidentally pass these to the optimizer, are they skipped over or still optimized? As in the following:model_conv = torchvision.models.resnet18(pretrained=True)
for param in model_conv.parameters():
param.requires_grad... | albanD | Hi,
Assuming no gradients were computed for them before and their .grad field is None to begin with. Then the optimizer will just ignore them because they don’t have any gradient (as the backward won’t populate them). |
melike | Hi all, I’m trying to implement a custom max unpooling layer. The difference fromtorch.nn.MaxUnpool2dis that all the max indices within the pooling window are used for unpooling in case of a repeated max value. Here is an example,pooled_inp = torch.tensor([[[[2., 4],
[6, 8]]]], requires_grad=T... | albanD | You don’t have to avoid them. It is just that autograd does not support every combination of them and it will raise an error if you hit such case.
So if your code runs without error, it means that autograd can handle this case just fine.
The only concern I would have with such implementation is t… |
ssrs | Hi, I am happy to find PyTorch support for complex numbers, but when I used torch.matrix_exp, it returned unexpected result.I think torch.matrix_exp may have the same function as scipy.linalg.expm, and they return same result on real matrix:import numpy as np
from scipy.linalg import expm
a=np.zeros((2,2),dtype=np.floa... | albanD | Hi!
Support for complex numbers with matrix_exp was added yesterday:https://github.com/pytorch/pytorch/pull/48363You can install a nightly build and it should work fine now! |
jzy95310 | Hi all. I’m currently a PhD student at Duke University and I’m using Pytorch to conduct my research. It’s nice to find such a great forum!I define the following network architecture wheremodel_resnet50_bnis a pre-trained ResNet50 with Batch Normalization layers in between.class MyPipeline(nn.Module):
def __init__(s... | albanD | Hi,
I don’t think there is any reason for the autograd to fail here.
You might want to make sure that you preprocess your data properly though to avoid any large value as it could hinder training.
For the architecture, it is very task-dependent I’m afraid. But for vision related tasks a pre-train… |
tyoc213 | It is possible to get whole graph ingrad_fnfor each iteration with the calculated gradients?In dot format or other?Also I find curios that if I printgrad_fn <AliasBackward object at 0x7fd60006ccf8>---------------------------------------------------| 0.00% [0/11 00:00<00:00]
grad_fn <AliasBackward object at 0x7fd5d025b7... | albanD | Hi,
This package will return a dot graph:https://github.com/szagoruyko/pytorchvizThe objects are re-used because the first one goes out of scope and is free. But later one, since you redo an allocation of the same size, the same memory is returned to you (many allocator do caching for allocation… |
shivammehta007 | Hello,When I try to backpropagate on a tensor full of -inf and I have a torch.logsumexp , the gradients of that becomes nan. Like the code below:>>> a = torch.nn.Parameter(torch.tensor([-float("inf"), -float("inf"), -float("inf")]))
>>> b = 2 + a
>>> torch.logsumexp(a, dim=0)
tensor(-inf, grad_fn=<LogsumexpBackward>)
>... | albanD | It depends on your optimizer.
If you don’t have momentum/accumulated terms, then you can simply set these gradients to 0 and your optimizer won’t change the values.
If you have a fancy optimizer that will update the weights even for a 0 gradient, the simplest solution might be to save the original… |
yoad.tewel | Hello!So I’ve got a machine with ubuntu 20.04 and rtx 3070. Is it possible to run pytorch at this time with support to the new GPUs?From my understanding for the rtx 3070 I need cudnn 8.0.5 and cuda 11.1, is there a way to get pytorch to work this these versions?What are my current options to install pytorch? (for exam... | albanD | Hi,
Current binaries for cuda 11.0 will work with these cards
There are perf issues with these because the current cuda libraries are not properly optimized for them. We will release 1.7.1 soon to update to cudnn 8.0.5 to fix some of these. But it won’t fix everything I’m afraid and we’ll have to … |
snowe | Hi everyoneI just noticed that when I train a network in an anaconda environment with cudatoolkit=10.2.89, I get different results to when I train the exact same network in a different environment with cudatoolkit=10.1.243 (everything else is the same). Is this behaviour to be expected?I seed everything and I can repro... | albanD | Hi,
I am afraid this is expected. Results (especially on CUDA) are reproducible only for a fix hardware/library version and if the deterministic flag is set to true on pytorch.
If you change anything there, the floating point arithmetic order can lead to different floating point results. These dif… |
111319 | When using zero-padding mode in Conv, the paddings are leaf nodes, so the gradient will not back-propagate through the padding to the previous layer.What about circular or reflect mode? In these two modes, the padding values are the sliced results of the previous layer, so that the gradient can back-propagate to previo... | albanD | Hi,
Yes the gradients will flow back to the input corresponding to everywhere it is used (including padding). |
algol | I am trying to create a custom loss function to train an autoencoder for image generation. In particular, I want to symmetrize the BCELoss() function. My attempt is as follows:import torch.nn.functional as F
from torch import nn
class symmBCELoss(nn.BCELoss):
def forward(self, input: Tensor, target: Tensor) -> Ten... | albanD | I am afraid BCELoss does not.
But looking at the code, BCELossWithLogits does (https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html?highlight=bce#torch.nn.BCEWithLogitsLoss)
So if you actually use a sigmoid before it and want to merge both, that will workOtherwise, you will… |
John_J_Watson | I am trying to build libtorch like so:USE_CUDA=0 cmake -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX:PATH=../pytorch-install ../pytorch &&\
USE_CUDA=0 cmake --build . --target installHowever, I see that it is still building with CUDAnot sur... | albanD | Hi,
Why are you building with CMake directly? If you want to do a python install, you should be using setup.py and the USE_CUDA flag will be properly picked up in that case.
If you are trying to do a libtorch install (I am not sure what is the process supposed to be), it might be that the flag is … |
deJQK | I have a checkpoint file which was trained with torch and the file extension is t7. Is it possible for me to load it in a pytorch model? Thanks. | albanD | Hi,
Very old versions of pytorch used to have a compatibility layer to do this but it was removed a while ago.
It might be simpler for your to dump the file in json from lua and reload it in python. It will be a bit slow but should be fairly simple. |
Ahmad_Nedal | I am implementing a triplet network in Pytorch where I use 3 forward passes and a single backward pass, similar to what is describedhere. My model is trained by optimizing triplet loss. After running the code, everything works as expected.However, I am still confused about the computation of backprop in this implementa... | albanD | Right but these formulas give the gradients wrt to the output of the net, not the weights. And you never actually sum the gradient contribution of the outputs (because these are different Tensors), only the weights and actually shared and so gradients are accumulated.
Does that explain what you see… |
Markos-NTUA | Hello everyone,while using pytorch’sfasterrcnn_resnet50_fpnI noticed thatafterpassing a list of images from resnet’s backbone there is a time interval (e.g. for a batch of 8 images its ~0.22 sec) where any following tensor gpu operation will have to wait in order to be completed. All tensors and models are on the GPU. ... | albanD | Hi,
This happens because the whole CUDA API is actually asynchronous and only blocks when the work queue on the GPU is full and you have to wait for it to process or because you want some data on the cpu side.
You can use torch.cuda.synchronize() to force synchronization of the GPU so that it wait… |
shivammehta007 | So, I was following this Hidden Markov Model Tutorial. But the limitation it has is that it breaks if PyTorch is > 1.5.0 it throws:https://colab.research.google.com/drive/1IUe9lfoIiQsL49atSOgxnCmMR_zJazKI#scrollTo=3CMdK1EfE1SJWhile training the forward algorithmRuntimeError: one of the variables needed for gradient com... | albanD | Setting set_detect_anomaly doesn’t give any other output
Make sure to use latest pytorch as we recently fix warnings not showing up in colab.
Or run your code in command line to have the corresponding forward code.
The code does quite a lot of inplace and viewing ops.
Plus, it is working with… |
catt_ale | Hello to everyone.I am traying my model inference time using:model.eval()
with torch.no_grad():
y = model(x)VSmodel.train()
y = model(x)These two operations take exactly the same time. Is it normal or am I making something wrong?Thanks in advance. | albanD | Hi,
The eval mode will make a difference only if you use special Modules that behave differently in eval mode like dropout or batchnorm. But even in that case, the runtime might not change that much.
The no_grad mode disables the autograd so it will make a significant difference in memory usage bu… |
Stonepia | I want to write a code to explicitly delegate index to all tensors and the result is that every tensor should have a default device().index() 0.So I wrote the code as follows:if (! rawTensor.device().has_index()){
rawTensor.device().set_index(0);
}However, this seems not work. Does this mean that I must explicitl... | albanD | If so, what is the point of offering a set_index() function?
I am not a specialist of that part of the code but I would expect this function to simply update the device object that was returned (so that you can pass it to a further constructor or .to function). I don’t expect it to modify the Ten… |
hughperkins | Let’s say I have a function that receives:a network module, containing multiple layersthe output of that network module, from passing in a batchnothing else… is there any way of somehow accessing the intermediate results in the intervening layers, from passing the batch through those layers, to get the output?I’m wonde... | albanD | Hey!
To reduce memory usage we try very hard not to save all of these no. So you cannot guarantee that they are actually saved.
You could use global nn.Module forward hooks to force saving some of the results during the forward pass so that you can access them later. |
Andrea_Rosasco | Hello,the problem I’m facing is quite complex and I’m not sure if I can reduce it to a minimal working example without cutting out some detail that might be the source of my problem, so I’ll try to be as clear as possible.The problem I’m working on is the re-implementation of the paper “Dataset Distillation”. The overa... | albanD | If you use nightly build, you can pass inputs= to .backward() to specify what you want to compute gradients for. In this case ds_loss.backward(inputs=(lr_list[j],), retrain_graph=True).
Otherwise, you can do grad, = autograd.grad(ds_loss, lr_list[j], retain_graph=True); lr_list[j].grad = grad but … |
Kyrollos_Yanny | I am performing some operations in Pytorch that require a very high degree of precision. I am currently using torch.float64 as my default datatype. All my numbers are real. I would like to use a float128 datatype (since memory is not an issue for this simulation). However, the only datatypes I find in the documentation... | albanD | Hi,
We don’t have any support for float128 I’m afraid. I don’t actually think that this type is supported by cudaIf you don’t care about cuda, I guess we could accept a PR adding this new data type and implementations for it but no core contributor is working on that atm.
But you can open an is… |
jemisjoky | I’m working on some wrappers for Pytorch functions with the goal ofextending the Tensor class, and am running into an issue with functions liketorch.mode(among many others) that return function-specific types liketorch.return_types.mode.I’d like to replace thevaluesattribute of the output object with a different tensor... | albanD | Hi,
You can re-use the original result to create a new instance of the same class:
out = torch.mode(inp)
final_out = out.__class__(new_values) |
vmoens | HiAssume you have a custom autograd.Function class that during backward calls autograd.grad.How can this call to backward know if in the ‘main code’ the option create_graph was set on?One option could be to always set on create_graph in the backward function but that has obviously unwanted consequences, especially in t... | albanD | Hi,
You can check if torch.is_grad_enabled() in the backward and if gd.requires_grad.
That will tell if you something wants the gradients to be computed for your function. Namely if grad mode is enabled and the input requires_grad then you should create the graph. Otherwise, it is not needed. |
Andrea_Rosasco | I need the gradient to flow back through a previous update step but the SGD step method is decorated with the no_grad property and executes the operation in-place.I tried to do that manually but if I use tensor.add_ to modify the model parameter I getRuntimeError: a leaf Variable that requires grad is being used in an ... | albanD | Hi,
Unfortunately there isn’t as the nn.Module is by design, not functional.
I woudl advise using a library likehttps://github.com/facebookresearch/higherthat handles all of that for you (and provide differentiable version of the pytorch optimizers as well). |
raraz15 | Hello, I am trying to implement my own Bidirectional RNN Model where theoutputis defined as thesum of hidden states from both directions. I want to know if autograd can backprop through this summation.def forward(self,x,state=None):
hidden_f = [] # forward direction hidden states
hidden_b = []... | albanD | Hi,
Do you actually see an error?
From your comments, you should not set requires_grad=True on the output if you don’t need to access its .grad field later.
And you don’t need to wrap things in Variables
So it should work just fine yes. |
antoniogois | if I have a 2D tensor like this one:>>> torch.ones((2, 4))
[[1, 1, 1, 1],
[1, 1, 1, 1]]and want to fill two positions per row with 0, to get:[[1, 0, 1, 0],
[0, 1, 1, 0]]I can do:torch.ones((2, 4)).index_put((torch.arange(2).unsqueeze(1), torch.LongTensor([[1,3], [0,3]])), torch.Tensor([0]))What about a 3D tensor? Let... | albanD | Hi,
For any number of dimensions, you can use scatter to achieve this:
import torch
ind= torch.tensor([[[1,3],
[0,3],
[1,2]],
[[0,2],
[1,2],
[2,3]]])
base = torch.ones(2, 3, 4)
base.scatter_(2, ind, 0… |
aydo | Hello,I have a (soft) adjacency tensoradjof sizeB x N x Mwith batch dimensionB. When I performadj.max(dim=2)I get a tuple of max values and max value indices, indicating for each row inNdimension where it’s maximal in regards toMdimension. Now I would like to use the returned max value indices toselectentries from ano... | albanD | Hi,
You can use these indices with the other_tensor.gather(dim, indices) function.
Note that you either need to use keepdim=True when you call max or unsqueeze the indices before giving them to gather. |
learner47 | I am aware that, while employingloss.backward()we need to specifyretain_graph=Trueif there are multiple networks and multiple loss functions to optimize each network separately. But even with (or without) specifying this parameter I am getting errors. Following is an MWE to reproduce the issue (on PyTorch 1.6).import t... | albanD | Well you don’t need to retain the graph in this case I think.
But even if you do so, retain_graph only prevents it from being freed during the backward pass. But when nothing can access it anymore, it will be freed: it does not leak memory. It just delays when the memory is released. |
learner47 | This is my class definition:class Tracker(nn.Module):
def __init__(self):
super(Tracker, self).__init__()
self.bigru = nn.GRU(input_size=2, hidden_size=100, batch_first=True, bidirectional=True)
self.fc1 = nn.Linear(200, 32)
self.fc2 = nn.Linear(32, 2)
def forward(self, inputs):
... | albanD | retain_graph is only needed if you call backward again without calling forward again. If you only call things once, there is no need for it. |
juliusbk | Hi,Many operations do not seem to be implemented for the dtype=complex yet. I am currently facing this problem:import numpy as np
import torch
import torch.fft
x = torch.tensor(np.random.random((30, 20, 10)), requires_grad=True)
t = torch.fft.rfft(x, dim=2)
t = torch.prod(t, dim=1) # or torch.exp(torch.sum(torch.log(... | albanD | You might want to try to do the multiplication by hand as I think the regular multiplication is already supported:
# replace t = torch.prod(t, dim=1) by
dim = 1
res = t.select(dim, 0)
for i in range(1, t.size(dim)):
res = res * t.select(dim, i)
t = res |
kirk86 | Hi folks,I’ve encountered this error today.Traceback (most recent call last):
File "testpytorch.py", line 162, in <module>
loss.backward()
File "/home/user/miniconda3/envs/torch/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_g... | albanD | Hi,
The ** expression routes to the pow operation.
The reason why one works and not the other is because of the way the derivatives are computed:
For sqrt, for better performance, the result is reused as you can seehere(you don’t need to understand the semantic but the point is that result is … |
NadiaMe | Let’s say I have a tensor of the sizetorch.Size([512, 5000, 14, 14])and I want to sum each 10 entries in second dim, e.gsum [512, 0:10, :, :] over dim 1sum [512, 10:20, :, :] over dim 1…So the resulting tensor is of size[512, 500, 14, 14]Is there any way to do it efficiently without loops? | albanD | Hi,
You can first view the Tensor before doing the reduction:
t.view(512, 500, 10, 14, 14).sum(2) |
ameliatqy | Hey guys,I was wondering, how do I softmax the weights of a torch Parameter? I want to the weight my variables A and B using softmaxed weights as shown in the code below.class RandomClass(torch.nn.module):
def __init__():
...
self._weights = torch.nn.Parameter(0.5*torch.ones(2), requires_grad=T... | albanD | Hi,
You should recompute the value in the forward but without trying to override the original Parameter:
class RandomClass(torch.nn.module):
def __init__():
...
self._weights = torch.nn.Parameter(0.5*torch.ones(2), requires_grad=True)
...
def forward():
… |
offset-null1 | Hey, I’m a beginner. I want to compute linear unit x dot w.T without bias. I followed this way of instantiation from tutorial:struct Net : torch::nn::Module {Net(int64_t N, int64_t M): linear(register_module(“linear”, torch::nn::Linear(N, M))){ }But according to this in Functions.h:static inline Tensor linear(const Ten... | albanD | Hi,
The functions implemented in Functions.h is the “functional” version that implements the forward, not the nn layer that you create with torch::nn::Linear().
You can see the class dochereand the options doc (that show to to disable bias)here |
malicd | I am trying to organize CycleGAN code in my own fashion and wile running (disclaimer: this is just a snipped but I hope it is self-explanatory)def optimize_parameters(self):
real_k = Variable(torch.rand([1, 128, 128])).cuda()
real_w = Variable(torch.rand([1, 128, 128])).cuda()
fake_k = self.generator_K(rea... | albanD | Hi,
This is surprising indeed given the code you shared.
Are you sure that you don’t save any state that you re-use in the gan_loss or the discriminator? |
pedropgusmao | Hi there,Could anyone please provide an example on how to setup mypy to properly work with PyTorch?I’m currently using :[mypy-torch.*]
# https://github.com/pytorch/pytorch/issues/42787#issuecomment-672419289
implicit_reexport = TrueI am aware that typing with PyTorch is still a work in progress. So it would be very m... | albanD | Hi,
You can check our own mypy ini file here:https://github.com/pytorch/pytorch/blob/master/mypy.iniIt is updated every time we add typing to new part of our code base. |
CDAWG | Hey All. (First post, maybe you have to be patient)I am trying to do prototype-based metric learning, using prototorch a torch extension, where the prototypes live in a subspace.An nn.parameter variable projects these prototypes and samples into this subspace, however it is not updated during training, although there a... | albanD | This is a bit dangerous as Parameters need to always be leafs and this might not be the case.
If you just want to update the content of a parameter without the autograd tracking it, you can do:
with torch.no_grad():
model.subspaces.copy_(orthogonalization(model.subspaces)) |
WowPy | Hi,I am trying to get the gradient of a vector (with length m and batch size N) with respect to another vector (with length m and batch size N). Hence, I am expecting the gradient matrix to be Nxmxm.For example,x = torch.rand(5, 3)
x.requires_grad_(True)
x.retain_grad()
u = x*x
dudx = grad(u, x, torch.ones(x.size()[0],... | albanD | Hi,
First, You seem to assume that N is a batch size that should be considered specially? But the autograd does not know about that. It will compute the gradient considering N as any other dimension.
Also autograd.grad() does a vector jacobian product (when grad_outputs is provided) and so will re… |
FlorentMeyer | Hello community,When I get a model on CPU then domodel.load_state_dict(torch.load(PATH, map_location=device))as explainedhere,model.devicedoesn’treturn thedevicespecified inmodel.load_state_dict(torch.load(PATH, map_location=device))but “cpu” instead. I then have to performmodel.to(device)for it to be on the desired de... | albanD | Yes the end result is the same. So no need to add a .to() if you already used map_location properly. |
kekgle | Hi! I am working on a personal NLP project that involves word and character embeddings.I want to merge together pre-computer word embeddings and word-embeddings built from character embeddings, through concatenation. The dimension of the pre-computed embeddings is [batch_size; sentence_length; 200], where batch_size is... | albanD | Hi,
As a general rule, any op that is not provided by pytorch will break the graph (should ideally fail to run if the Tensor requires grad).
But here you can simply use torch.split or torch.chunk and all will be differentiable |
paganpasta | Hi,I have a network which outputs2values,xandy. I intend to not use the outputyfor training. Will the backward pass add weights with garbage values due toybranch?Below is just an illustration of the model at hand.model = common_model -> [head_x, head_y]The optimisers forxandyhead are initialized withmodel.parameters()... | albanD | Hi,
If y is not used, then no gradient will flow back from there. And only the contribution from x will count. |
hadaev8 | Does pytorch or cuda have any specific optimization or something? | albanD | Hi,
No it is not mandatory.
And power of 2 are not particularly important either.
Maybe powers of 32 that are the size of the streaming multiprocessors? But even that depends a lot on how the cuda kernel is implemented and, in general, won’t lead to any significant difference. |
jeff52415 | Summary : I found memory cached or usage increase significantly on Conv2d for specific input shape,like from torch.randn(14, 512, 2, 64) to torch.randn(15, 512, 2, 64), the memory could suddenly increase 500~1000MB, while I change 64 to 128 (width dimension), the memory usage come back to normal.layer = torch.nn.Conv2d... | albanD | Hi,
cudnn has many algorithms it can choose from to perform convolution. This choice depends on the input size and so a small change in input size might trigger a different algorithm to be used and thus different memory behavior.
You can try setting torch.backends.cudnn.benchmark=True for cudnn to… |
Roy_Paik | I am using LSTM to make Language Model and I found out freezing embedding weight makesVolatile GPU-Utilgo up. (30% -> 80%). I don’t get it why it happens. Would you give me some advice about the issue(?)?weight_vec = torch.load('./data/pretrained_embedding.pt')
model.emb.weight.data.copy_(weight_vec)
model.emb.weight.r... | albanD | Hi,
This might be because the autograd is not running, so the the CPU has less work to do and can send work to the GPU faster? |
ChrisLiu2 | I’m working on a graph neural network with dgl library. What makes me uncertain is that at one point, I calculate a pairwise attention using a simple MLP between adjacent node, and create a new node in the graph if a certain pair has scores higher than some threshold. This graph will be used in the next step to do grap... | albanD | You cannot define gradients for discrete quantities. So tricky here mean not possibleA trick that can be used to get around this is to make these quantities continuous. But this is not always possible and can have very weird interpretation depending on the application. For the connectivity here … |
btil | Is there any way I can get the scalar loss to backprop through the model even when the loss is calculated with tensors not associated with the model? Custom autograd function? Currently I am getting None gradients for the model.im1 = torch.tensor(..., requires_grad=True) # image
im2 = torch.tensor(..., requires_grad=T... | albanD | More or less.
As would see it as hiding from the autograd the fact that you break the graph |
a_d | Hello all,I have a model and a dataset class. On a fresh boot, the system takes up 1.8GB of ram with no process running. The dataset class upon initialization takes up an additional 2 ~2.5 GB as it stores some variables for further reference. I instantiate the model class and pass it to the training function which look... | albanD | Hi,
Can you try checking the ram usage if you just do a simple cuda op like torch.rand(10, device="cuda")? The cpu size memory usage of the cuda driver is known to be very large. |
cdalvarezb | Hello guys, i´m trying to solve the Poisson´s equation by using the relaxation method to know the potential and electric field matrixs but i have an error that say “index 101 is out of bounds for axis 0 with size 101” and i dont understand what is the problem. ¿Can anyone helpme please?import numpy as npimport mathSYM... | albanD | Hi,
You should have a stack trace of where the error happened right? The error means that the index you use is out of bound of the Tensor you try to read from (python is 0 indexed, so for a Tensor of size 101, the valid indices are 0 to 100 |
sohaib_attaiki | Hi,I’m using Pytorch 1.5.1.I’m having a problem using some functions that exist is the documentation, but I got the error'torch' has no attribute.For example, the code provided in thispytorch linkdoesn’t work:>>> import torch
>>> x=torch.randn(4, 2)
>>> torch.view_as_complex(x)
Traceback (most recent call last):
File... | albanD | Hi,
I am afraid this is not something that can easily be backported to older versions of pytorch as they don’t have complex support.
You will have to use 1.6+ I’m afraid |
btil | I wish to update my PolicyNet network based on a loss from two variables not on the graph. So, any idea how I can only update PolicyNet based on a loss that does not require grad? Thanks.actions = PolicyNet.forward(state)
loss = criterion(a,b) # a and b have requires_grad=False
loss = Variable(loss, requires_grad=True)... | albanD | If your eval network is just a net with requires_grad=False. It won’t present the output from requiring gradients if the input does. So if the input to the eval net requires grad, then the output will as well.
And if there is a function that computes these values based on the action, then they shou… |
Juls | Dear all,if we fix the model architecture, is it possible to extract the actual function that computes the gradient of the loss wrt the model’s parameters?It can be interesting for learning purposes and also enable fast porting of the python code to FPGAs using HLS.It can be interesting | albanD | Hi,
No there is no such tool I’m afraid.
Most of the backward functions are not even exposed as user APIs. |
HaziqRazali | This seems really silly but where is the forward() function of the mask rcnn? I have been looking throughhttps://github.com/pytorch/vision/blob/2831f11abcb9ec7b951b6bbbcb7a85b79ee2fd79/torchvision/models/detection/mask_rcnn.pybut can’t find it at all.I am trying to modify the mask rcnn’s forward passhttps://pytorch.org... | albanD | Hi,
It is inherited from its parent class.
So all the way to this class:https://github.com/pytorch/vision/blob/2831f11abcb9ec7b951b6bbbcb7a85b79ee2fd79/torchvision/models/detection/generalized_rcnn.py#L15 |
Mahmoud_Abdelkhalek | My main training and validation loop looks like this:import torch
def train(net,dataloader,loss_func,optimizer,device):
net.train()
num_true_pred = 0
total_loss = 0
for images,labels in dataloader:
images = images.to(device)
labels = labels.to(device)
... | albanD | Hi,
Yes the net is modified inplace by the optimizer. So no need to return it. |
iacolippo | Hi folksI am reimplementing this paperhttps://arxiv.org/abs/1909.01311a method that allows backward and forward unlocking (i.e. you can compute the “gradients” of a layer as soon as you have executed the forward of such layer). This is a dummy implementationclass Linear(nn.Linear):
def __init__(self, in_features, o... | albanD | Hi,
If there are no synchronization points (I don’t see one in your code), then yes it will be. |
niata | I want to set requires_grad to True on the input to find out what information is used.When doing that on the cpu everything is fine, but when using the gpu it doesn’t like that.RuntimeError: cudnn RNN backward can only be called in training modelhere is an example (the model is simplified):import torch
import torch.nn ... | albanD | Hi,
You will have to disable cudnn during the rnn computation for this to work I’m afraid.
cudnn does not support double backward. Hence the error you’re seeing. |
James_Yip | Hi all,I want to transfer a sequence representation as the node representation of size (batch_size, num_nodes, hidden_size) for a graph model. I usescatter_to assign the sequence embedding of correct indexes to the node representation. And thenode_embeddingis finally used for graph-level prediction. However, the model ... | albanD | It might also be a problem with your model not being expressive enough to push the accuracy up?
But from a pure autograd point of view, I don’t think there is any issue with using scatter. |
jwillette | I was looking at the Pytorch pruning tutorial (https://pytorch.org/tutorials/intermediate/pruning_tutorial.html#) and I am left confused about where in the process this pruning happens.Does the setup in the tutorial happen before training, and then it is trained with the pruning method somewhere in the loopDo the strat... | albanD | Hi,
This tutorial shows how to use pruning for the weights that are used during training.
It is not a pre or post processing technique.
In particular, the prunning happen when you access the weights where you registered the prunning, they will automatically get prunned. |
gshen | Hi all,My code works fine in PyTorch v1.0.0. However, in PyTorch v1.6.0, the line torch.set_default_tensor_type(torch.cuda.DoubleTensor) causes a Cannot re-initialize CUDA in forked subprocess error. I noticed that this is due to the fork call when using num_workers > 0 in the PyTorch dataloader. My guess is that its b... | albanD | I’m afraid this is not possible to do as setting the cuda type causes cuda to be initialized and the limitation with fork and cuda is due to the cuda driver itself, not pytorch. So there is little we can do.
Note that in general, I would advise against setting the default type on cuda as it might m… |
hanzCV | Hi, I want to initialize myclass(torch.autograd.Function), with some variables, however, I could not see any example like that. When I try to initialize the object with__init__(), theforward passcannot find those variables. Is it possible to do so?Bellow is the only example I could find, where the class MyRelu doesn’t ... | albanD | Hi,
No this is not possible.
We don’t really use Function as class but more as a convenient way to store the pair of functions for forward and backward.
You can pass these arguments directly to the forward though. (and return None for their grad in the backward). |
willprice | What is the purpose oftorch.unbind? Can I not just iterate over the tensor itself indexing the the dimension I want to slice? I don’t really understand why it exists.Thanks! | albanD | Hi,
Yes unbind is similar to creating a list of slices of the Tensor.
Unbind is going to be slightly faster than creating this list and doing the slicing by hand. |
Sudarshan_Babu | why is this code not crashingimport torch
x=2.0
y =2.0
param = torch.nn.Parameter(torch.tensor(x))
opt = torch.optim.SGD([param],lr =.1)
loss = torch.nn.Parameter(torch.tensor(y))
loss.backward()
opt.step()
print('done')Should not the optimizer complain saying param was not used in the computation ?Thanks in advance! | albanD | Hi,
Optimizers don’t do that in general no. They will ignore Tensors whose .grad field is None and use the gradient that is there if there is one. |
Paritosh | I am trying a two-way classification using a linear layer:nn.Linear(4096, 2)to get the final predictions; and deliberately using target from 50 classes. I think I should be getting an error when using CrossEntropy loss, since target has classes outside of final linear layer. However, I am not getting the any error. I a... | albanD | Hi,
For performance reasons, we cannot do as many checks on the cuda side as we can do on the cpu sideRunning this on the CPU should raise a nice error.
Also I think we improved the GPU behavior in master so you can try with a nightly build. |
JWarlock | Hi, I am using my own custom std function for some reason.I used to let keepdim=False as default, and everything worked just fine. However, I find that if keepdim=True, the gpu memory usage just keep going up every iteration and finally explode.The function looks like this:class CustomStd(torch.autograd.Function):
... | albanD | Hi,
In this case, you should not save it on ctx at all and only with save_for_backward:
I couldn’t run the code so there might be typos. But this is the idea:
class CustomStd(torch.autograd.Function):
@staticmethod
def forward(ctx, input, dim=None, keepdim=False, eps=1e-5, unbiased=True):… |
raceee | I have some really big input tensors and I was running into memory issues while building them, so I read them one by one into a.ptfile. As I run the script that generates and saves the file, the file gets bigger and bigger, so I am assuming that the tensors are saving correctly. Here is that code:with open(a_sync_save,... | albanD | Ho for that, the answer is definitely yes for the first and no for the second.
Our dataloaders under the hood do the exact same thing of loading things from the disk actually in some cases.
So the fact that memory is in ram or is read on the fly does not change at all how the training is going to … |
Krishna_Garg | If I have two different neural networks (parametrized by model1 and model2) and corresponding two optimizers, would the below operation using model1.parameterswithout detach()lead to change in its gradients? My requirement is that I want to just compute the mean squared loss between the two model parameters but update ... | albanD | Detach is used to break the graph to mess with the gradient computation.
In 99% of the cases, you never want to do that.
The only weird cases where it can be useful are the ones I mentioned above where you want to use a Tensor that was used in a differentiable function for a function that is not e… |
mathematics | I was building custom loss function.I cant usenn.Moduleextension because as Ptrblck told, I cant usenn.modulewhen numpy operations is in it,Custom loss functionsAutograd won’t be able to track the numpy operations, so you would need to implement the backward pass manually via a customautograd.FunctionI couldnt usetorch... | albanD | Hi,
np.maximum or things, which is wip in Pytorch
Not sure what you mean by that. You can use torch.max() to get element-wise maximum. Or you can use the threshold function if you just want a threshold as seems to be the case in your code.
I would recommend you read the doc that explains how to… |
amirhf | I am reading through the‘Extending PyTorch’that implements a newnn.Moduleand uses the function that has bothforward()andbackward()implemented. My question is if I want to define a new module that just adds a random weight to the input tensor and I define it like this:class CustomLayer(nn.Module):
def __init__(self,... | albanD | Hi,
Yes you only need to write a backward function if:
You want to compute something that is not the “true” gradient that is computed by the autograd
Your forward function is not handled by the autograd (because you use custom function or third party library)
And the example in the tutorial is i… |
Simon_C | Hi, it seems that my very elementary complex exponential does not support Autograd :z = torch.tensor([1.1-2j], requires_grad=True)
f = torch.exp(z)gives me a RunTimeError :---------------------------------------------------------------------------
RuntimeError Traceback (most recent call la... | albanD | Hi,
In preparation for the 1.7 release and to avoid issues, we added error messages for all the functions that were not yet audited for complex autograd.
We are working on auditing the formulas and re-enabling them.
cc@anjali411do we have an issue describing the process if people want to help h… |
saul_santos | Let’s suppose I have the code below and I want to calculate the jacobian of L, which is the prediction made by a neural network in Pytorch, L is of size nx1 where n is the number of samples in a mini batch. In order to avoid a for loop for each entry of L (n entries) to calculate the jacobian for each sample in the min... | albanD | Hi,
First I can’t understand why is the gradient of the sum the same of the sum of the gradients for each sample in pytorch architecture.
This is happens because of the linearity of the derivatives:
d/dqqd(L0 + L1 + L2) = dL0/dqqd + dL1/dqqd + dL2/dqqd
But this assumes that L0, L1 and L2 are i… |
swalton | So I was playing around trying to learn gradient checkpointing. I found an interesting behavior that does not match my understanding of the paper I found that there was a sweet spot for the number of checkpoints and going beyond that memory would increase. I found the exact same behavior withcheckpoint_sequentialandche... | albanD | Do I have a bug somewhere?
I don’t think so.
So my understanding is that the more checkpoints I do the lower my memory usage should be.
This is not true no. The checkpointing only saves the input/output and is able to free all the buffers in the middle. But if the content of the checkpoint i… |
albanD | The DataParallel takes a Module as input so it can contain anything you wantAnd yes what is executed is what is in the forward function of your Module.The imbalance won’t come from theloss.backward()because it runs at the same place as the forward. So if the forward is balanced, the backward will be as well. | albanD | From the stack trace it looks like the problem is with the outputs no?
Maybe your forward returns Tensors that are not on the right device? |
Alan_Wang | When usingdetect_anomoly, I’m getting an nan in the backward pass of a squaring function. This confuses me because both the square and its derivative should not give nans at any point. I’ve checked that the nan arises in the backward pass and not the forward pass. Am I missing something here?Here’s the full error:The f... | albanD | inf - inf would give nan IIRC.
It seems that setting set_detect_anomaly on prevents any nan detection (all the outputs are False). Is this expected?
No but maybe your code is “flaky” and depending on the run, the nan don’t appear at the same place? |
SAI_VARSHITTHA | For the weights, we setrequires_gradafter the initialization, since we don’t want that step included in the gradient. (Note that a trailing_in PyTorch signifies that the operation is performed in-place.)I found this in the following link :Pytorch nn tutorialBut why isrequires_gradnot set in the initialisation of weight... | albanD | Hi,
I think the reason is in the sentence you linked: " we don’t want that step (I guess the division in that example) included in the gradient".
The initialization is just filling the original values and should not be considered when computing derivatives of the net. |
qiminchen | Hi,I have to dotorch.inverse()on tensor with a size of4 x 240 x 320 x 3 x 3every iteration during training. Sincetorch.inverse()supports batch inverse, I guess3 x 3is too small sotorch.inverse()is pretty slow on GPU. So I moved the batch from GPU to CPU when doingtorch.inverse()and move the output back to GPU for other... | albanD | Hi,
No moving Tensors across devices is perfectly differentiable. It will all work fine! |
HaydenW | Hi, I’m very new to PyTorch and I have been trying to extend an autograd function that tunes multiple thresholds to return a binary output and optimize using BCELoss, but I’ve been struggling with the fact that any sign or step function I apply always returns a gradient of 0. In some instances I’ve been able to get it ... | albanD | Hi,
You can either design a smoothed version of your loss function that will have non zero gradients.
Or you can use this piecewise constant function but design a backward to compute something that is not the true gradient but will point in the right direction using acustom autograd.Function. |
kila_suelika | Frompytorch’sproject in github, I can findMSELossImpl::forward()intorch/csrc/api/src/nn/modules/loss.cpp.This function callsF::detail::mse_loss(input, target, options.reduction());, it’s intorch/csrc/api/include/torch/nn/functional/loss.h.AgainF::detail::mse_lossmagically calls:return torch::mse_loss(
expanded_inpu... | albanD | Hi,
Both the c++ and python binding are generated based onthis file.
Here since there are no specific function name for the backend, there is a function in Aten/native with that name. For mse, you can find ithere. Hope this helps. |
ElToto | Hello I want to create a noise which if added to normal images create adversarial examples.I am getting a lot of images from my dataloader and I want to add the noise to each image.The model is pretrained so it correctly classifies the original images without the noise.I want to train this noise so that the prediction ... | albanD | Hi,
You should use with torch.no_grad(): around the code that should not track gradients. That will solve the issue for clamp_ |
ElToto | I have a standard dataloader which loads images.On top of every image I want to add a static tensor.But I want to clamp this to (0,1).This new image is used to train a model.The following code roughly show the important steps.(everything is on gpu)static_tensor = torch.load(path)
for img in dataloader:
img = img.cud... | albanD | Hi,
Your static Tensor should not have requires_grad=True I guess.
And in that case, doing any op here will increase the memory usage as we need to save some values for the backward.
Note that you should never use .data in general!
Here you can use .detach() which will have similar behavior but … |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.