Comments (2)
Hmm, it works as expected according to the posted function signatures (note that arguments after *
are keyword only arguments but I guess it could've been documented better.
from pytorch.
As the error message shows,
TypeError: sort() received an invalid combination of arguments - got (Tensor, int, bool, bool), but expected one of:
- (Tensor input, *, bool stable, int dim, bool descending, tuple of Tensors out)
- (Tensor input, int dim, bool descending, *, tuple of Tensors out)
- (Tensor input, *, bool stable, name dim, bool descending, tuple of Tensors out)
- (Tensor input, name dim, bool descending, *, tuple of Tensors out)
when it comes to 4 arguments, without any keyword specification, it will be ambiguous for sort() to deal arguments with same type.
torch.sort(my_tensor, 0) # Works
use default values, no ambiguity here.
torch.sort(my_tensor, 0, False) # Works
IMO that is an edge case which needs to be clarified in the document. It might be assumed to apply to stable
instead of descending
.
from pytorch.
Related Issues (20)
- [torch.compile][distributed] Collective ops in FX graph should not be erased by DCE pass even its result is not used in current rank. HOT 3
- Inconsistent floating point guards with numpy scalars HOT 2
- "RuntimeError: memory format option is only supported by strided tensors " during using flash_attn
- RuntimeError: _int_mm_out_cuda not compiled for this platform. HOT 6
- For `repeat()`, `sizes` argument doesn't work while `repeats` argument works against the doc HOT 2
- torch.export.unflatten fails on sequential models HOT 2
- Error using torch.func transforms with DDP (broadcast_buffers=True) HOT 2
- [inductor][cpu]opacus_cifar10 performance regression in 2024-07-15 nightly release HOT 2
- Improve detail / Create tutorial for torch.distributions
- Cannot construct torch::nn::Module on Windows HOT 2
- [inductor][cpu]MT5ForConditionalGeneration, T5ForConditionalGeneration and T5Small performance regression in 2024-07-15 nightly release HOT 2
- Document ProcessGroupOptions
- For `expand()`, `sizes` argument doesn't work while `size` argument works against the doc HOT 2
- float8 types cannot be used under deterministic mode HOT 2
- Error when torch.compile function uses saved_tensor_hooks HOT 2
- [torch.export] Torch Export produces incorrect program when python generators are used. HOT 2
- Compiled DDP + TP unit test fails with `SymNodeVariable() is not a constant` HOT 4
- Adam optimizer initializer useless if condition, torch v2.3.0 HOT 1
- Runtime error when running huggingface pretrained model with torch-xla
- xpu backend build fails if cloned directory is named python-x.y HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.