code: def np2model_tensor(a):
      "Tranform numpy array `a` to a tensor of the same type."
      dtype = model_type(a.dtype)
      res = as_tensor(a)
      if not dtype: return res
      return res.type(dtypef np2model_tensor(a):
      "Tranform numpy array `a` to a tensor of the same type."
      dtype = model_type(a.dtype)
      res = as_tensor(a)
      if not dtype: return res
      return res.type(dtype)
docs: Tranform numpy array `a` to a tensor of the same type.