Created
August 24, 2023 19:35
-
-
Save johnbanq/3fd1cd94e5681cfd5ed006e1c17efdf2 to your computer and use it in GitHub Desktop.
patch for fixing the header file in pytorch3d #1024
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cast.h b/cast.h | |
index 0caccdb..f2e1db1 100644 | |
--- a/cast.h | |
+++ b/cast.h | |
@@ -1424,6 +1424,16 @@ public: | |
template <typename _T> using cast_op_type = pybind11::detail::cast_op_type<_T>; | |
}; | |
+// Base implementation for std::tuple and std::pair | |
+template <template <typename...> class Tuple, typename... Ts> | |
+class tuple_caster; | |
+ | |
+template <typename T1, typename T2> class type_caster<std::pair<T1, T2>> | |
+ : public tuple_caster<std::pair, T1, T2> {}; | |
+ | |
+template <typename... Ts> class type_caster<std::tuple<Ts...>> | |
+ : public tuple_caster<std::tuple, Ts...> {}; | |
+ | |
// Base implementation for std::tuple and std::pair | |
template <template<typename...> class Tuple, typename... Ts> class tuple_caster { | |
using type = Tuple<Ts...>; | |
@@ -1503,12 +1513,6 @@ protected: | |
Tuple<make_caster<Ts>...> subcasters; | |
}; | |
-template <typename T1, typename T2> class type_caster<std::pair<T1, T2>> | |
- : public tuple_caster<std::pair, T1, T2> {}; | |
- | |
-template <typename... Ts> class type_caster<std::tuple<Ts...>> | |
- : public tuple_caster<std::tuple, Ts...> {}; | |
- | |
/// Helper class which abstracts away certain actions. Users can provide specializations for | |
/// custom holders, but it's only necessary if the type has a non-standard interface. | |
template <typename T> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution is from: facebookresearch/pytorch3d#1024