MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / OpMetadataToString

Function OpMetadataToString

tensorflow/compiler/xla/service/hlo_instruction.cc:3432–3448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3430}
3431
3432string OpMetadataToString(const OpMetadata& metadata) {
3433 std::vector<string> result;
3434 if (!metadata.op_type().empty()) {
3435 result.push_back(StrCat("op_type=\"", CEscape(metadata.op_type()), "\""));
3436 }
3437 if (!metadata.op_name().empty()) {
3438 result.push_back(StrCat("op_name=\"", CEscape(metadata.op_name()), "\""));
3439 }
3440 if (!metadata.source_file().empty()) {
3441 result.push_back(
3442 StrCat("source_file=\"", CEscape(metadata.source_file()), "\""));
3443 }
3444 if (metadata.source_line() != 0) {
3445 result.push_back(StrCat("source_line=", metadata.source_line()));
3446 }
3447 return StrJoin(result, " ");
3448}
3449
3450string RandomDistributionToString(const RandomDistribution& distribution) {
3451 return absl::AsciiStrToLower(RandomDistribution_Name(distribution));

Callers 1

Calls 6

CEscapeFunction · 0.85
StrCatFunction · 0.50
emptyMethod · 0.45
op_typeMethod · 0.45
push_backMethod · 0.45
op_nameMethod · 0.45

Tested by

no test coverage detected