Export torch::jit::toIValue (#54449)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/54448

Pull Request resolved: https://github.com/pytorch/pytorch/pull/54449

Reviewed By: SplitInfinity

Differential Revision: D27243154

Pulled By: cpuhrsch

fbshipit-source-id: fc21d6ce251b868356ad8ea13ae891fb56e311ce
diff --git a/torch/csrc/jit/python/pybind_utils.h b/torch/csrc/jit/python/pybind_utils.h
index 1009456..fd9ae6c 100644
--- a/torch/csrc/jit/python/pybind_utils.h
+++ b/torch/csrc/jit/python/pybind_utils.h
@@ -58,7 +58,7 @@
 
 void clear_registered_instances(void* ptr);
 
-IValue toIValue(
+TORCH_API IValue toIValue(
     py::handle obj,
     const TypePtr& type,
     c10::optional<int32_t> N = c10::nullopt);