def _set_grad_type(self, params, train_program):
    for param in params:
        grad_name = (param.name + core.grad_var_suffix())
        grad_var = train_program.desc.block(0).find_var(cpt.to_bytes(grad_name))
        if (grad_var is None):
            continue
        param._set_grad_type(grad_var.type())
def _set_grad_type(self, params, train_program):
    for param in params:
        grad_name = (param.name + core.grad_var_suffix())
        grad_var = train_program.desc.block(0).find_var(cpt.to_bytes(grad_name))
        if (grad_var is None):
            continue
        param._set_grad_type(grad_var.type())