abfb048e3edcc4163ad237592f3cc92412613648,pytext/metric_reporters/channel.py,TensorBoardChannel,add_scalars,#TensorBoardChannel#Any#Any#Any#,318

Before Change


                metrics object will be prepended with the prefix.
            metrics (Any): The metrics object.
        
        for field_name, field_value in metrics._asdict().items():
            if isinstance(field_value, (int, float)):
                self.summary_writer.add_scalar(
                    f"{prefix}/{field_name}", field_value, epoch

After Change


                metrics object will be prepended with the prefix.
            metrics (Any): The metrics object.
        
        if hasattr(metrics, "_asdict"):
            metrics = metrics._asdict()
        for field_name, field_value in metrics.items():
            if isinstance(field_value, (int, float)):
                self.summary_writer.add_scalar(
                    f"{prefix}/{field_name}", field_value, epoch
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/pytext
Commit Name: abfb048e3edcc4163ad237592f3cc92412613648
Time: 2020-07-14
Author: arbabu@fb.com
File Name: pytext/metric_reporters/channel.py
Class Name: TensorBoardChannel
Method Name: add_scalars


Project Name: facebookresearch/pytext
Commit Name: 85f8b90bfd82e0a68de4e6a2b38e7ec79c6a5ec4
Time: 2019-06-09
Author: zsc@fb.com
File Name: pytext/task/new_task.py
Class Name: _NewTask
Method Name: _init_tensorizers


Project Name: facebookresearch/pytext
Commit Name: a4227867f1283faf4d72da7212fc1e1110567afd
Time: 2019-05-16
Author: zsc@fb.com
File Name: pytext/task/new_task.py
Class Name: _NewTask
Method Name: _init_tensorizers