How to use Relay Control Flow?

can you send a PR to add your implementation of LSTM converter? This is a requested feature (see https://github.com/apache/incubator-tvm/issues/6474)

Unrolling is the standard way to implement lstm op conversion. Both MXNet and ONNX frontend do it. I don’t recommend pursuing the approach of control flow when the number of layers are known at compile time.

There is a usage of generating a while loop in PyTorch frontend, here https://github.com/apache/incubator-tvm/blob/main/python/tvm/relay/frontend/pytorch.py#L3222-L3223. You can use this to turn a static lstm op to a dynamic lstm. But the usage is complicated so I don’t recommend it.