def test_stack_dynamic_from_input(self, compute_unit, backend, frontend):
        """The dynamic dimension comes from input directly instead of using RangeDim."""
        if frontend == TorchFrontend.EXECUTORCH:
            pytest.skip("ExecuTorch dynamic shape propagation error")

        class StackModel(torch.nn.Module):
            def forward(self, render_size):
                first_dim = torch.squeeze(torch.tensor([6], dtype=torch.int32))
                second_dim = torch.squeeze(torch.pow(render_size, 2))
                input1 = torch.ones((6, 9216))
                input2 = torch.ones((6, 9216))
                input3 = torch.ones(
                    (first_dim, second_dim)
                )  # Has shape (6, 9216) when render_size is 96.
                input4 = torch.ones_like(input3)
                return torch.stack([input1, input2, input3, input4], dim=-1)

        converter_input_type = [ct.TensorType(shape=(1,), dtype=np.int32)]
        render_size = torch.tensor([96], dtype=torch.int32)

        TorchBaseTest.run_compare_torch(
            render_size,
            StackModel(),
            input_as_shape=False,
            converter_input_type=converter_input_type,
            frontend=frontend,
            backend=backend,
            compute_unit=compute_unit,
        )
The dynamic dimension comes from input directly instead of using RangeDim.
coremltools/converters/mil/frontend/torch/test/test_torch_ops.py