1 #ifndef STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP
2 #define STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP
3 
4 #include <stan/math/prim/meta.hpp>
5 #include <stan/math/prim/fun/identity_free.hpp>
6 #include <stan/math/rev/fun/to_var_value.hpp>
7 
8 namespace stan {
9 namespace math {
10 
11 /**
12  * Returns the result of applying the identity constraint
13  * transform to the input. For any of the inputs being a `var_value` type
14  * this promotes the input `x` to `var_value`.
15  *
16  * @tparam T Any type.
17  * @tparam Types Any type with one of `T` and `Types` being a `var_value`
18  * matrix.
19  * @param[in] x object
20  * @return transformed input
21  */
22 template <typename T, typename... Types,
23           require_any_var_matrix_t<T, Types...>* = nullptr>
identity_free(T && x,Types &&...)24 inline auto identity_free(T&& x, Types&&... /* args */) {
25   return to_var_value(x);
26 }
27 
28 }  // namespace math
29 }  // namespace stan
30 
31 #endif
32