This sounds like a good use case for the dynamic shaping added in PR #3606. Using relay.Any would require that we use the relay VM rather than the graph runtime for execution though and may have some unpleasant interactions with autotuning. I suspect the dynamic shape won’t be a problem for downstream nodes in the graph and we can properly get their shapes using infer_value.
Regardless of how smoothly something like this integrates, it’s definitely worth exploring as dynamism is only going to become more common.