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

Function Count

tensorflow/compiler/xla/service/instruction_fusion_test.cc:188–198  ·  view source on GitHub ↗

Counts the number of HLO ops with a given op code in the specified module.

Source from the content-addressed store, hash-verified

186
187// Counts the number of HLO ops with a given op code in the specified module.
188static int Count(const HloModule& module, HloOpcode op) {
189 int count = 0;
190 for (const auto* computation : module.computations()) {
191 for (const auto* instruction : computation->instructions()) {
192 if (instruction->opcode() == op) {
193 ++count;
194 }
195 }
196 }
197 return count;
198}
199
200TEST_F(InstructionFusionTest, FuseCheapNonDuplicatableOps) {
201 auto module = ParseAndReturnVerifiedModule(R"(

Callers 1

TEST_FFunction · 0.70

Calls 3

computationsMethod · 0.80
instructionsMethod · 0.80
opcodeMethod · 0.80

Tested by

no test coverage detected