Skip to content

Commit eacde8d

Browse files
committed
fix(//core/conversion): Add special case for If and Loop
which are handled by conversion and not a converter Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 3c59ece commit eacde8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/conversion/conversion.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ namespace conversion {
2020
bool isNodeConversionIgnored(const torch::jit::Node* n);
2121

2222
bool OpSupported(const torch::jit::Node* n) {
23-
return evaluators::shouldEvalAtConversionTime(n) || converters::node_is_convertable(n);
23+
return evaluators::shouldEvalAtConversionTime(n)
24+
|| converters::node_is_convertable(n)
25+
|| n->kind() == torch::jit::prim::Loop
26+
|| n->kind() == torch::jit::prim::If;
2427
}
2528

2629
c10::optional<torch::jit::IValue> EvaluateNode(ConversionCtx* ctx, const torch::jit::Node* n, int level, int limit) {

0 commit comments

Comments
 (0)