code: def _as_numerical_dtype(dtype: tf.DType) -> tf.DType:
      dtype = tf.as_dtype(dtype)
      if dtype.is_floating or dtype.is_integer:
          return dtype
      raise ValueError(
          "Expected integer or floating point type, got {}".format(
              dtype
          )
      )
  
imports: import abc
  import collections
  from typing import Iterable, Mapping, Optional, Union
  import numpy
  from sonnet.src import types
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _as_numerical_dtype(dtype) and returns: dtype