code: def eval_decorator(fn):
      def inner(model, *args, **kwargs):
          was_training = model.training
          model.eval()
          out = fn(model, *args, **kwargs)
          model.train(was_training)
          return out
  
      return inner
  
imports: import functools
  from math import sqrt
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from einops import rearrange
label_desc: Use image node_id 2 for calling a global function with example usage: eval_decorator(fn) and returns: inner, out