code: def _check_function(function_factory, tensor):
      function = function_factory(tensor)
      if not hasattr(c_lib, function):
          raise ValueError(
              "Tensor type %s is not supported." % tensor.type()
          )
      if not tensor.is_contiguous():
          raise ValueError("Tensor is required to be contiguous.")
      return function
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from distutils.version import LooseVersion
  import torch
  from byteps.torch import c_lib
  from byteps.common import BytePSBasics
  from byteps.torch.compression import Compression
label_desc: Use image node_id 1 for calling a global function with example usage: _check_function(function_factory, tensor) and returns: function