We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc0730 commit 76dc804Copy full SHA for 76dc804
core/conversion/var/Var.cpp
@@ -147,11 +147,15 @@ bool Var::isITensor() const {
147
}
148
149
bool Var::isITensorList() {
150
- if (isList() && ptr_.ivalue->isCustomClass()) {
151
- return true;
152
- } else {
153
- return false;
+ // Unpack the Var as a List and check if each entry is a custom class since
+ // ITensors are stored in CustomClassHolder
+ auto ival_list = ptr_.ivalue->toList();
+ for (int i = 0; i < ival_list.size(); i++) {
154
+ if (!ival_list.get(i).isCustomClass()) {
155
+ return false;
156
+ }
157
158
+ return true;
159
160
161
std::vector<nvinfer1::ITensor*> Var::unwrapToITensorList() {
0 commit comments