code: def _test_dtype_compatibility(
      layer, sparse=False, edges=False, **kwargs
  ):
      total = positive = 0
      dtypes_all = ["int32", "int64", "float16", "float32", "float64"]
      for dtypes in itertools.product(
          *([dtypes_all] * (3 if edges else 2))
      ):
          total += 1
          layer_instance = layer(**kwargs, dtype=dtypes[0])
          inputs = _get_input_from_dtypes(dtypes, sparse=sparse)
          try:
              layer_instance(inputs)
              print(
                  "sparse" if sparse else "dense",
                  "".join([f"{dtype:10s}" for dtype in dtypes]),
                  "OK",
              )
              positive += 1
          except Exception as e:
              print(
                  "sparse" if sparse else "dense",
                  "".join([f"{dtype:10s}" for dtype in dtypes]),
                  "FAIL",
                  # e
              )
              # raise e
              pass
      print(f"RATIO: {positive / total}")
      with open("dtype_ratio.txt", "a") as f:
          f.write(f"{layer.__name__:20s} {positive / total:.2f}\n")
      assert positive / total >= 0.2
  
file_path: spektral/tests/test_layers/convolutional/core.py
imports: import itertools
  import numpy
  import tensorflow
  from tensorflow.keras import Input, Model
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 7 for calling a global function with example usage: _test_dtype_compatibility(layer, sparse, edges) without return types