code: def test_fmeasure():
      a = np.array(
          [
              [
                  [
                      [1.0, 1.0, 1.0, 0.0, 0.0],
                      [1.0, 1.0, 1.0, 0.0, 0.0],
                      [1.0, 1.0, 1.0, 0.0, 0.0],
                      [1.0, 0.0, 0.0, 0.0, 0.0],
                      [0.0, 0.0, 0.0, 0.0, 0.0],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      b = np.array(
          [
              [
                  [
                      [1.0, 1.0, 1.0, 0.0, 0.0],
                      [1.0, 1.0, 0.0, 0.0, 0.0],
                      [0.0, 0.0, 0.0, 1.0, 1.0],
                      [0.0, 0.0, 0.0, 1.0, 1.0],
                      [0.0, 0.0, 0.0, 0.0, 1.0],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      set_fixed_random_seed(1)
      input_dim = (1, 5, 5)
  
      input_tensor = C.input_variable(input_dim)
      target_tensor = C.input_variable(input_dim)
      z = C.fmeasure(input_tensor, target_tensor)
  
      score = z.eval({input_tensor: a, target_tensor: b})
      FMEASURE_EXPECTED_VALUES = [[[[0.5]]]]
  
      assert np.allclose(score, FMEASURE_EXPECTED_VALUES)
  
imports: import numpy
  import cntk
  from _cntk_py import set_fixed_random_seed
  import pytest
  from os import environ
label_desc: Use image node_id 1 for calling a global function with example usage: test_fmeasure() without return types