Skip to content

Commit

Permalink
use default_factory and not a mutable dictionary (#1788)
Browse files Browse the repository at this point in the history
Summary:
Sorry, I broke this yesterday

Pull Request resolved: #1788

Reviewed By: xuzhao9

Differential Revision: D47810975

Pulled By: janeyx99

fbshipit-source-id: 9109d2446e4d41d917f957eb9925f757126f058b
  • Loading branch information
janeyx99 authored and facebook-github-bot committed Jul 26, 2023
1 parent 4ea9354 commit 83f17f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions userbenchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
import yaml
from pathlib import Path
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Callable

REPO_PATH = Path(os.path.abspath(__file__)).parent.parent
Expand Down Expand Up @@ -49,8 +49,8 @@ class TorchBenchABTestResult:
control_env: Dict[str, str]
treatment_env: Dict[str, str]
details: Dict[str, TorchBenchABTestMetric]
control_only_metrics: Dict[str, float] = {}
treatment_only_metrics: Dict[str, float] = {}
control_only_metrics: Dict[str, float] = field(default_factory=dict)
treatment_only_metrics: Dict[str, float] = field(default_factory=dict)
# the repository to bisect, default to "pytorch"
bisection: str = "pytorch"
# can be "abtest" or "bisect"
Expand Down

0 comments on commit 83f17f9

Please sign in to comment.