-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(//core/partitioning): Add an ostream implementation for
PartitionInfo Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com>
- Loading branch information
1 parent
24c3a22
commit ee536b6
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <iostream> | ||
#include <sstream> | ||
#include <utility> | ||
|
||
#include "core/partitioning/PartitionInfo.h" | ||
|
||
namespace trtorch { | ||
namespace core { | ||
namespace partitioning { | ||
// clang-format off | ||
std::ostream& operator<<(std::ostream& os, const PartitionInfo& s) { | ||
os << "Settings requested for Torch Fallback:" \ | ||
<< "\n \"enabled\": "; | ||
if (s.enabled) { | ||
os << "True"; | ||
os << "\n \"min_block_size\": " << s.min_block_size \ | ||
<< "\n \"forced_fallback_operators\": ["; | ||
for (auto i : s.forced_fallback_operators) { | ||
os <<"\n " << i << ','; | ||
} | ||
os << "\n ]"; | ||
} else { | ||
os << "False"; | ||
} | ||
return os; | ||
} | ||
// clang-format on | ||
} // namespace partitioning | ||
} // namespace core | ||
} // namespace trtorch |