so im using scikit learn OPTICS to calculate clusters. that requires the input x to be in numpy. i did do requires_grad() like you said, but i have to detach before i send it to calculate gap or it gives me
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.