mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Enable ATen implementation of some NN functions and Variable methods
This commit is contained in:
committed by
Edward Z. Yang
parent
a385979677
commit
5989b05ecc
@ -78,6 +78,9 @@ bool FunctionParameter::check(PyObject* obj) {
|
||||
if (PyTuple_Check(obj) || PyList_Check(obj)) {
|
||||
return true;
|
||||
}
|
||||
if (optional && obj == Py_None) {
|
||||
return true;
|
||||
}
|
||||
// if a size is specified (e.g. IntList[2]) we also allow passing a single int
|
||||
return size > 0 && THPUtils_checkLong(obj);
|
||||
}
|
||||
|
Reference in New Issue
Block a user