You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto b = condition ? n->blocks()[0] : n->blocks()[1];
213
+
214
+
for (constauto bn : b->nodes()) {
215
+
if (bn->kind() == torch::jit::prim::Loop) {
216
+
EvaluateLoopBlock(ctx, bn);
217
+
} elseif (bn->kind() == torch::jit::prim::If) {
218
+
EvaluateConditionalBlock(ctx, bn);
219
+
} else {
220
+
TRTORCH_CHECK(evaluators::shouldEvalAtConversionTime(bn), "TRTorch currently can only compile conditionals that are evaluatable at conversion time but node " << *bn << " cannot be evaluated.")
221
+
auto eval = EvaluateNode(ctx, bn);
222
+
if (!eval.value().isTensor()) {
223
+
LOG_DEBUG(ctx->logger, "(Conditional Evaluation) Found the value to be: " << eval.value());
224
+
} else {
225
+
LOG_DEBUG(ctx->logger, "(Conditional Evaluation) Found the value to be a tensor (shape " << eval.value().toTensor().sizes() << ')');
TRTORCH_CHECK(evaluators::shouldEvalAtConversionTime(bn), "TRTorch currently can only compile loops that are evaluatable at conversion time but node " << *bn << " cannot be evaluated.");
257
+
auto eval = EvaluateNode(ctx, bn);
226
258
if (!eval.value().isTensor()) {
227
259
LOG_DEBUG(ctx->logger, "(Loop Evaluation) Found the value to be: " << eval.value());
0 commit comments