code: def test_ewma_log_with_s():
      ewma_log = EwmaLog(alpha=0.5)
      input1 = torch.tensor(-1.0)
      s1 = torch.tensor(210.0)
      ewma_log(input1, s1)
      assert_equal(ewma_log.ewma, input1)
      input2 = torch.tensor(-1.0)
      s2 = torch.tensor(210.5)
      ewma_log(input2, s2)
      true_ewma = (1.0 / 3) * (torch.exp(s1 - s2) * input1 + 2 * input2)
      assert_equal(ewma_log.ewma, true_ewma)
  
file_path: pyro/tests/contrib/oed/test_ewma.py
imports: import math
  import pytest
  import torch
  from pyro.contrib.oed.eig import EwmaLog
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_ewma_log_with_s() without return types