mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix invalidArguments for functions with tuple outputs, but no other (#468)
arguments. For example: >>> torch.randn(5, 5).geqrf('invalid arg') TypeError: geqrf received an invalid combination of arguments - got (str), but expected ()
This commit is contained in:
committed by
Soumith Chintala
parent
a09f653f52
commit
473e795277
@ -301,9 +301,12 @@ std::pair<Option, std::string> _parseOption(const std::string& _option_str,
|
||||
printable_option.erase(out_pos);
|
||||
printable_option += "*, ";
|
||||
printable_option += kwonly_part;
|
||||
} else {
|
||||
} else if (out_pos >= 2) {
|
||||
printable_option.erase(out_pos-2);
|
||||
printable_option += ")";
|
||||
} else {
|
||||
printable_option.erase(out_pos);
|
||||
printable_option += ")";
|
||||
}
|
||||
has_out = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user