code: def test_mean(mode):
      a = iscalar("a")
      b = iscalar("b")
      z = mean(a, b)
      z_fn = pytensor.function([a, b], z, mode=mode)
      res = z_fn(1, 1)
      assert np.allclose(res, 1.0)
  
      a = fscalar("a")
      b = fscalar("b")
      c = fscalar("c")
  
      z = mean(a, b, c)
  
      z_fn = pytensor.function(
          [a, b, c], pytensor.grad(z, [a]), mode=mode
      )
      res = z_fn(3, 4, 5)
      assert np.allclose(res, 1 / 3)
  
      z_fn = pytensor.function(
          [a, b, c], pytensor.grad(z, [b]), mode=mode
      )
      res = z_fn(3, 4, 5)
      assert np.allclose(res, 1 / 3)
  
      z = mean()
      z_fn = pytensor.function([], z, mode=mode)
      assert z_fn() == 0
  
imports: import numpy
  import pytest
  import pytensor
  import pytensor.tensor
  import tests.unittest_tools
  from pytensor.compile.mode import Mode
  from pytensor.graph.fg import FunctionGraph
  from pytensor.link.c.basic import DualLinker
  from pytensor.scalar.basic import ComplexError, Composite, InRange, ScalarType, add, and_, arccos, arccosh, arcsin, arcsinh, arctan, arctan2, arctanh, cast, complex64, constant, cos, cosh, deg2rad, eq, exp, exp2, expm1, float16, float32, floats, int8, int32, ints, invert, log, log1p, log2, log10, mean, mul, neq, rad2deg, reciprocal, sin, sinh, sqrt, switch, tan, tanh, true_div, uint8
  from pytensor.tensor.type import fscalar, imatrix, iscalar, matrix
  from tests.link.test_link import make_function
label_desc: Use image node_id 9 for calling a global function with example usage: test_mean(mode) without return types