def _copy_some_through(current, candidate):
    'Copy some tensors through via array_ops.where.'
    current_flat = nest.flatten(current)
    candidate_flat = nest.flatten(candidate)
    result_flat = [_on_device((lambda : array_ops.where(elements_finished, current_i, candidate_i)), device=candidate_i.op.device) for (current_i, candidate_i) in zip(current_flat, candidate_flat)]
    return nest.pack_sequence_as(structure=current, flat_sequence=result_flat)
Copy some tensors through via array_ops.where.
def _copy_some_through(current, candidate):
    
    current_flat = nest.flatten(current)
    candidate_flat = nest.flatten(candidate)
    result_flat = [_on_device((lambda : array_ops.where(elements_finished, current_i, candidate_i)), device=candidate_i.op.device) for (current_i, candidate_i) in zip(current_flat, candidate_flat)]
    return nest.pack_sequence_as(structure=current, flat_sequence=result_flat)