code: def test_to_default_float(x: Union[float, tf.Tensor]) -> None:
      default_float_x = to_default_float(x)
      _x = x if isinstance(x, float) else float(x.numpy())
      assert default_float_x.numpy() == _x
  
file_path: GPflow/tests/gpflow/utilities/test_misc.py
imports: from typing import Any, Union
  import numpy
  import pytest
  import tensorflow
  import tensorflow_probability
  from gpflow.base import Parameter
  from gpflow.utilities import is_variable, to_default_float
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_default_float(x) without return types