    def test_input_broadcast_dynamic_shape(
        self,
        input_dynamic_dim_idx,
        mask_dynamic_dim_idx,
        dynamic_dim_dict,
        input_shape,
        mask_shape,
        test_name="masked_select_broadcast_dynamic_shape",
        dtype="float16",
        benchmark=False,
    ):
        """
        Check that broadcast dynamic shape is handled correctly.
        """

        input_rank = len(input_shape)
        mask_rank = len(mask_shape)
        max_rank = max(input_rank, mask_rank)
        input_dynamic_shape = []
        mask_dynamic_shape = []
        for idx in range(max_rank):
            if idx >= max_rank - input_rank:
                if idx in input_dynamic_dim_idx and idx in dynamic_dim_dict:
                    input_dynamic_shape.append(dynamic_dim_dict[idx])
                else:
                    input_dynamic_shape.append(input_shape[idx - max_rank + input_rank])
            if idx >= max_rank - mask_rank:
                if idx in mask_dynamic_dim_idx and idx in dynamic_dim_dict:
                    mask_dynamic_shape.append(dynamic_dim_dict[idx])
                else:
                    mask_dynamic_shape.append(mask_shape[idx - max_rank + mask_rank])

        self._test_broadcastable_dynamic_masked_select(
            input_dynamic_shape=input_dynamic_shape,
            mask_dynamic_shape=mask_dynamic_shape,
            input_shape=input_shape,
            mask_shape=mask_shape,
            test_name=test_name,
            dtype=dtype,
            benchmark=benchmark,
        )
Check that broadcast dynamic shape is handled correctly.
tests/unittest/ops/test_masked_select.py