code: def test_linspace_forward_half(start, stop, num, ctx, func_name):
      ext, dtype = ctx.backend[0].split(":")
      assert dtype == "float"
      ctx_h = ext_utils.get_extension_context(ext, type_config="half")
      ctx_h.device_id = ctx.device_id
      with nn.context_scope(ctx_h):
          o_h = force_tuple(F.linspace(start, stop, num))
  
      o_h[0].parent.forward([], o_h)
      y_h = [o.d.copy() for o in o_h]
      y_np = force_tuple(ref_linspace_half(start, stop, num))
  
      # numpy.linspace function is running with dtype=float16,
      # therefore the output results will usually match.
      # If it does not, check the algorithm and whether it is acceptable.
      for y, l in zip(y_h, y_np):
          assert y.all() == l.all()
  
file_path: nnabla/python/test/function/test_linspace.py
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context, function_tester, half_test, force_tuple
  from nnabla.testing import assert_allclose
  import nnabla
  import nnabla.ext_utils
label_desc: Use image node_id 4 for calling a global function with example usage: test_linspace_forward_half(start, stop, num, ctx, func_name) without return types