Skip to content

Commit

Permalink
[Cleanup] Use push_back instead of emplace_back where appropriate (go…
Browse files Browse the repository at this point in the history
…/totw/112)

PiperOrigin-RevId: 708102524
  • Loading branch information
frgossen authored and Google-ML-Automation committed Dec 20, 2024
1 parent 2c3d306 commit cb7ae41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions xla/hlo/transforms/collectives/collective_quantizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ std::vector<HloInstruction*> FindDequantizationSubgraphRecursive(
return {};
}

subgraph.emplace_back(instr);
subgraph.push_back(instr);
if (Match(instr, ConvertToWiderType())) {
return subgraph;
}
Expand Down Expand Up @@ -231,15 +231,15 @@ std::optional<ConversionSubgraph> IsSupportedQuantization(
BitcastPreservesElementType(), m::Copy(), m::Reshape(),
m::Slice(), m::Multiply(), m::Divide(), m::Clamp()))) {
if (instr->user_count() > 0) {
ops.emplace_back(instr);
ops.push_back(instr);
instr = instr->users()[0];
continue;
}
break;
}

if (Match(instr, ConvertToNarrowerType())) {
ops.emplace_back(instr);
ops.push_back(instr);
break;
}
VLOG(5) << "Unsupported instruction.";
Expand Down
4 changes: 2 additions & 2 deletions xla/hlo/transforms/host_offloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ absl::StatusOr<bool> UpdateMemorySpaceForHostOffloadedOutputs(
// If instruction is MoveToHost, we will replace usage.
if (instr_and_shape.instruction->IsCustomCall(
host_memory_offload_annotations::kMoveToHostCustomCallTarget)) {
to_replace.emplace_back(instr_and_shape);
to_replace.push_back(instr_and_shape);
continue;
}

Expand Down Expand Up @@ -1014,7 +1014,7 @@ absl::StatusOr<bool> HostOffloader::HandleRedundantCopiesBackToHost(

queue.push(successor);
host_instrs_tree.mutable_element(output_shape_index)
->emplace_back(successor);
->push_back(successor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/transforms/simplifiers/float_normalization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ absl::Status FloatNormalizationVisitor::ChangeOutputTypeThenInsertConvertBack(
if (allow_excess_precision && user->opcode() == HloOpcode::kConvert &&
user->shape().element_type() == to && to == HighPrecisionType() &&
from == LowPrecisionType()) {
conversions_to_simplify.emplace_back(user);
conversions_to_simplify.push_back(user);
} else {
TF_RETURN_IF_ERROR(hlo->ReplaceUseWithDifferentShape(user, new_hlo));
}
Expand Down

0 comments on commit cb7ae41

Please sign in to comment.