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

Method __init__

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

Source from the content-addressed store, hash-verified

66
67class ValidationLoss(Metric):
68 def __init__(self, data_length):
69 super(ValidationLoss, self).__init__()
70 self.clear()
71 self.data_length = data_length
72 pipeline_stages = context.get_auto_parallel_context("pipeline_stages")
73 per_stage_device_num = get_group_size() // pipeline_stages
74 stage_id = get_rank() // per_stage_device_num
75 self.is_last_stage = (stage_id == pipeline_stages - 1)
76
77 def clear(self):
78 """Clear the internal evaluation result."""

Callers

nothing calls this directly

Calls 2

clearMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected