def METHOD_NAME():
    unique_embeddings_tensor = flow.tensor(init_value, requires_grad=False).to(
        "cuda"
    )
    if use_optional_tensor:
        lr_tensor = flow.tensor(
            np.array(learning_rate).reshape(1,).astype(np.float32)
        ).to("cuda")
        down_scale_by_tensor = flow.tensor(
            np.array((down_scale_by,)).astype(np.float32)
        ).to("cuda")
    else:
        # pass by attr
        lr_tensor = None
        down_scale_by_tensor = None
    def train_one_iter(
        ids,
        unique_embeddings,
        embedding_grad,
        lr_tensor,
        down_scale_by_tensor,
        skip_if,
    ):
        return graph(
            ids,
            unique_embeddings,
            embedding_grad,
            lr_tensor,
            down_scale_by_tensor,
            skip_if,
        )
    for i in range(train_iters):
        np_ids = np.zeros(num_rows)
        np_ids[0 : num_valid_seq[i]] = np.arange(num_valid_seq[i])
        # add ids of num_valid unique to use id_shuffle out_put num_unique as grad input
        ids = flow.tensor(np_ids.astype(np.int32)).to("cuda")
        grad_tensor = flow.tensor(random_grad_seq[i]).to("cuda")
        if use_optional_tensor:
            skip_if_tensor = flow.tensor(
                np.array(skip_if_seq[i]).reshape(1,).astype(np.int64)
            ).to("cuda")
        else:
            skip_if_tensor = None
        updated_tensor = train_one_iter(
            ids,
            unique_embeddings_tensor,
            grad_tensor,
            lr_tensor,
            down_scale_by_tensor,
            skip_if_tensor,
        )
        unique_embeddings_tensor[0 : num_valid_seq[i]] = updated_tensor[
            0 : num_valid_seq[i]
        ]
    return unique_embeddings_tensor