C++ API 'nn::Sequential' has inconsistent behavior with python conterpart #19499
Labels
module: cpp
Related to C++ API
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Bug
To Reproduce
C++ version
Python Version
nn::Sequential
doesn't overloadoperator()
like other functions (e.g.,nn::Conv2d, nn::BatchNorm
), while in itsforward
function, it has anAT_CHECK
onis_empty() == false
, which makes usingnn::Sequential
as identity function impossible.Suggestion
The C++ version should implement
nn::Sequential::operator()(...)
, which should silently return x whenis_empty() == true
.Environment
The text was updated successfully, but these errors were encountered: