def _test_slice_scatter_multi_dsts(
        self,
        *,
        input_shapes,
        input_start_indices,
        input_end_indices,
        dim,
        dtype="float16",
    ):
        """test cases where a tensor being sliced has multiple dsts"""

        logging.info(
            f"multi_dsts e2e test with input_shapes: {input_shapes}, "
            f"start_indices: {input_start_indices}, end_indices: {input_end_indices}"
        )
        target = detect_target()

        Ys_pt = []
        Xs_pt = []
        for input_shape, start_indices, end_indices in zip(
            input_shapes, input_start_indices, input_end_indices
        ):
            X_pt = get_random_torch_tensor(input_shape, dtype)
            Xs_pt.append(X_pt)
            slice_indices = [slice(i, j) for i, j in zip(start_indices, end_indices)]
            Y_pt = X_pt[slice_indices]
            Ys_pt.append(Y_pt)
        Y0_pt = torch.cat(Ys_pt, dim)

        input0_shape = Xs_pt[0].size()
        other_X_pt = get_random_torch_tensor(input0_shape, dtype)
        Xs_pt.append(other_X_pt)
        Y1_pt = Xs_pt[0] + other_X_pt

        Y0, Y1 = self._make_test_graph_multi_dsts(
            input_shapes, input_start_indices, input_end_indices, dim, dtype
        )

        y0_shape = [var._attrs["values"][0] for var in Y0._attrs["shape"]]
        y1_shape = [var._attrs["values"][0] for var in Y1._attrs["shape"]]
        np.testing.assert_equal(y0_shape, Y0_pt.size())
        np.testing.assert_equal(y1_shape, Y1_pt.size())

        test_name = "slice_scatter_multi_dsts"
        dll_name = f"test_{self.test_count}.so"
        module = compile_model((Y0, Y1), target, "./tmp", test_name, dll_name=dll_name)
        debug_sorted_graph = module.debug_sorted_graph
        sorted_ops = graph_utils.get_sorted_ops(debug_sorted_graph)
        self.assertEqual(len(sorted_ops), 2)
        if sorted_ops[0]._attrs["op"] == "fused_elementwise":
            slice_scatter_op = sorted_ops[1]
        else:
            slice_scatter_op = sorted_ops[0]
        self.assertEqual(slice_scatter_op._attrs["op"], "slice_scatter")
        for idx, x in enumerate(slice_scatter_op._attrs["inputs"]):
            self.assertEqual(x._attrs["name"], "input_{}".format(idx))

        input_name_to_index = module.get_input_name_to_index_map()
        inputs = [0 for i in range(len(Xs_pt))]
        for i, X_pt in enumerate(Xs_pt):
            inputs[input_name_to_index[f"input_{i}"]] = X_pt
        y0 = get_torch_empty_tensor(y0_shape, dtype)
        y1 = get_torch_empty_tensor(y1_shape, dtype)
        module.run_with_tensors(inputs, [y0, y1])
        self.assertTrue(torch.allclose(Y0_pt, y0, atol=1e-2, rtol=1e-2))
        self.assertTrue(torch.allclose(Y1_pt, y1, atol=1e-2, rtol=1e-2))
        self.test_count += 1
test cases where a tensor being sliced has multiple dsts
tests/unittest/compiler/test_slice_scatter_pattern.py