def log()

in torchnet/logger/visdomlogger.py [0:0]


    def log(self, *args, **kwargs):
        if self.win is not None and self.viz.win_exists(win=self.win, env=self.env):
            if len(args) != 2:
                raise ValueError("When logging to {}, must pass in x and y values (and optionally z).".format(
                    type(self)))
            x, y = args
            self.chart(
                X=np.array([x]),
                Y=np.array([y]),
                update='append',
                win=self.win,
                env=self.env,
                opts=self.opts,
                **kwargs)
        else:
            if self.plot_type == 'scatter':
                chart_args = {'X': np.array([args])}
            else:
                chart_args = {'X': np.array([args[0]]),
                              'Y': np.array([args[1]])}
            self.win = self.chart(
                win=self.win,
                env=self.env,
                opts=self.opts,
                **chart_args)
            # For some reason, the first point is a different trace. So for now
            # we can just add the point again, this time on the correct curve.
            self.log(*args, **kwargs)