Skip to content

Warning with torch::nn::init::orthogonal_ with LibTorch 1.9.0 #60060

@ankane

Description

@ankane

🐛 Bug

Hi, it looks like torch::nn::init::orthogonal_ calls a deprecated function internally, which prints the following warning:

[W BatchLinearAlgebra.cpp:1940] Warning: torch.qr is deprecated in favor of torch.linalg.qr and will be removed in a future PyTorch release.
The boolean parameter 'some' has been replaced with a string parameter 'mode'.
Q, R = torch.qr(A, some)
should be replaced with
Q, R = torch.linalg.qr(A, 'reduced' if some else 'complete') (function operator())

To Reproduce

Compile and run the following script:

#include <torch/torch.h>

int main() {
  auto x = torch::empty({3, 5});
  torch::nn::init::orthogonal_(x);
}

Expected behavior

No warning

Environment

  • PyTorch Version (e.g., 1.0): LibTorch 1.9.0
  • OS (e.g., Linux): macOS 11.4
  • How you installed PyTorch (conda, pip, source): Downloaded from pytorch.org
  • Build command you used (if compiling from source): n/a
  • Python version: n/a
  • CUDA/cuDNN version: None
  • GPU models and configuration: n/a

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @lezcano @albanD @jbschlosser

Metadata

Metadata

Assignees

Labels

module: deprecationmodule: linear algebraIssues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmulmodule: nnRelated to torch.nntriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions