Enable ATen implementation of some NN functions and Variable methods

This commit is contained in:
Sam Gross
2017-10-16 11:34:58 -07:00
committed by Edward Z. Yang
parent a385979677
commit 5989b05ecc
6 changed files with 182 additions and 624 deletions

View File

@ -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);
}