code: def create_tensor_func(
      torch_create_tensor_func, from_dtype, to_dtype
  ):
      def new_create_tensor_func(*args, **kwargs):
          if "dtype" in kwargs and kwargs["dtype"] is not None:
              if kwargs["dtype"] == from_dtype:
                  kwargs["dtype"] = to_dtype
          return torch_create_tensor_func(*args, **kwargs)
  
      return new_create_tensor_func
  
imports: import torch
  from typing import Any, List, Optional, Union
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: create_tensor_func(torch_create_tensor_func, from_dtype, to_dtype) and returns: new_create_tensor_func, torch_create_tensor_func