code: def _create_eval_metric(metric_name: str) -> mx.metric.EvalMetric:
          
          # output_names refers to the list of outputs this metric should use to update itself, e.g. the softmax output
          if metric_name == C.ACCURACY:
              return utils.Accuracy(ignore_label=C.PAD_ID, output_names=[C.SOFTMAX_OUTPUT_NAME], label_names=[C.TARGET_LABEL_NAME])
          elif metric_name == C.PERPLEXITY:
              return mx.metric.Perplexity(ignore_label=C.PAD_ID, output_names=[C.SOFTMAX_OUTPUT_NAME], label_names=[C.TARGET_LABEL_NAME], name=C.PERPLEXITY)
          elif metric_name == C.LENRATIO_MSE:
              return loss.LengthRatioMSEMetric(name=C.LENRATIO_MSE,
                                    output_names=[C.LENRATIO_OUTPUT_NAME], label_names=[C.LENRATIO_LABEL_OUTPUT_NAME])
          else:
              raise ValueError("unknown metric name")
docs: Creates an EvalMetric given a metric names.