Hi @YongyiTang92 @apaszke, I tried clone in my following code, but still give me the same error as @YongyiTang92 's. Thanks for your help.
        phi = x_out[:, :, 0] # [B, C]
        phi.clone()
        Batch = phi.shape[0]
        
        for i in range(Batch):        	
        	phi[i] = phi_constant * phi[i].clone() + phi_offset