<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_scalar(self, name, value, step):
 """Log a scalar variable."""

        self.writer.add_scalar(name, value, step)