MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / __init__

Method __init__

codegeex/mindspore/src/metrics.py:31–38  ·  view source on GitHub ↗
(self, data_length)

Source from the content-addressed store, hash-verified

29 """
30
31 def __init__(self, data_length):
32 super(PPLMetric, self).__init__()
33 self.clear()
34 self.data_length = data_length
35 pipeline_stages = context.get_auto_parallel_context("pipeline_stages")
36 per_stage_device_num = get_group_size() // pipeline_stages
37 stage_id = get_rank() // per_stage_device_num
38 self.is_last_stage = (stage_id == pipeline_stages - 1)
39
40 def clear(self):
41 """Clear the internal evaluation result."""

Callers 1

__init__Method · 0.45

Calls 1

clearMethod · 0.95

Tested by

no test coverage detected