code: def test_scaler(s, target, observed, expected_scale):
      target_scaled, _, scale = s(target, observed)
  
      assert torch.allclose(
          expected_scale, scale
      ), "mismatch in the scale computation"
  
      if s.keepdim:
          expected_target_scaled = torch.div(target, expected_scale)
      else:
          expected_target_scaled = torch.div(
              target, expected_scale.unsqueeze(s.dim)
          )
  
      assert torch.allclose(
          expected_target_scaled, target_scaled
      ), "mismatch in the scaled target computation"
  
imports: import torch
  import pytest
  from gluonts.torch import scaler
label_desc: Use image node_id 1 for calling a global function with example usage: test_scaler(s, target, observed, expected_scale) without return types