Commit b3e9d8f8 authored by Paul's avatar Paul
Browse files

Formatting

parent 3ed217c9
...@@ -32,7 +32,6 @@ struct leaky_relu ...@@ -32,7 +32,6 @@ struct leaky_relu
check_shapes{inputs, *this}.has(1); check_shapes{inputs, *this}.has(1);
return inputs.front(); return inputs.front();
} }
}; };
} // namespace op } // namespace op
......
...@@ -13,7 +13,7 @@ namespace detail { ...@@ -13,7 +13,7 @@ namespace detail {
struct reflect_placeholder struct reflect_placeholder
{ {
template<class... Ts> template <class... Ts>
int operator()(Ts&&...) const int operator()(Ts&&...) const
{ {
return 0; return 0;
...@@ -33,14 +33,15 @@ auto reflect_impl(rank<0>, T&, Selector) ...@@ -33,14 +33,15 @@ auto reflect_impl(rank<0>, T&, Selector)
} }
template <class T> template <class T>
auto reflectable_impl(rank<1>, T&& x) -> decltype(T::reflect(x, reflect_placeholder{}), std::true_type{}); auto reflectable_impl(rank<1>, T&& x)
-> decltype(T::reflect(x, reflect_placeholder{}), std::true_type{});
template <class T> template <class T>
auto reflectable_impl(rank<0>, T&&) -> decltype(std::false_type{}); auto reflectable_impl(rank<0>, T &&) -> decltype(std::false_type{});
} // namespace detail } // namespace detail
template<class T> template <class T>
using is_reflectable = decltype(detail::reflectable_impl(rank<1>{}, std::declval<T>())); using is_reflectable = decltype(detail::reflectable_impl(rank<1>{}, std::declval<T>()));
template <class T, class Selector> template <class T, class Selector>
......
...@@ -354,29 +354,23 @@ struct cpu_op ...@@ -354,29 +354,23 @@ struct cpu_op
{ {
return op.compute(output_shape, std::move(args)); return op.compute(output_shape, std::move(args));
} }
friend bool operator==(const cpu_op& x, const cpu_op& y) friend bool operator==(const cpu_op& x, const cpu_op& y) { return x.op == y.op; }
{
return x.op == y.op;
}
friend bool operator==(const cpu_op& x, const operation& y) friend bool operator==(const cpu_op& x, const operation& y)
{ {
if(x.name() != y.name()) if(x.name() != y.name())
return false; return false;
return x == any_cast<cpu_op>(y); return x == any_cast<cpu_op>(y);
} }
friend bool operator==(const operation& x, const cpu_op& y) friend bool operator==(const operation& x, const cpu_op& y) { return y == x; }
{
return y == x;
}
}; };
// struct cpu_contiguous // struct cpu_contiguous
// { // {
// op::contiguous op; // op::contiguous op;
// std::string name() const { return "cpu::contiguous"; } // std::string name() const { return "cpu::contiguous"; }
// shape compute_shape(const std::vector<shape>& inputs) const { return op.compute_shape(inputs); } // shape compute_shape(const std::vector<shape>& inputs) const { return
// argument compute(context&, const shape& output_shape, std::vector<argument> args) const // op.compute_shape(inputs); } argument compute(context&, const shape& output_shape,
// std::vector<argument> args) const
// { // {
// return op.compute(output_shape, std::move(args)); // return op.compute(output_shape, std::move(args));
// } // }
...@@ -419,8 +413,9 @@ struct cpu_pad ...@@ -419,8 +413,9 @@ struct cpu_pad
// { // {
// op::concat op; // op::concat op;
// std::string name() const { return "cpu::concat"; } // std::string name() const { return "cpu::concat"; }
// shape compute_shape(const std::vector<shape>& inputs) const { return op.compute_shape(inputs); } // shape compute_shape(const std::vector<shape>& inputs) const { return
// argument compute(context&, const shape& output_shape, std::vector<argument> args) const // op.compute_shape(inputs); } argument compute(context&, const shape& output_shape,
// std::vector<argument> args) const
// { // {
// return op.compute(output_shape, std::move(args)); // return op.compute(output_shape, std::move(args));
// } // }
...@@ -481,7 +476,8 @@ struct cpu_gemm ...@@ -481,7 +476,8 @@ struct cpu_gemm
// { // {
// op::gather op; // op::gather op;
// std::string name() const { return "cpu::gather"; } // std::string name() const { return "cpu::gather"; }
// shape compute_shape(const std::vector<shape>& inputs) const { return op.compute_shape(inputs); } // shape compute_shape(const std::vector<shape>& inputs) const { return
// op.compute_shape(inputs); }
// argument compute(context&, const shape& output_shape, std::vector<argument> args) const // argument compute(context&, const shape& output_shape, std::vector<argument> args) const
// { // {
...@@ -930,7 +926,6 @@ struct cpu_apply ...@@ -930,7 +926,6 @@ struct cpu_apply
// apply_map["div"] = simple_op<cpu_binary<div_op>>(); // apply_map["div"] = simple_op<cpu_binary<div_op>>();
// apply_map["max"] = simple_op<cpu_binary<max_op>>(); // apply_map["max"] = simple_op<cpu_binary<max_op>>();
// apply_map["min"] = simple_op<cpu_binary<min_op>>(); // apply_map["min"] = simple_op<cpu_binary<min_op>>();
} }
void apply() void apply()
...@@ -946,7 +941,7 @@ struct cpu_apply ...@@ -946,7 +941,7 @@ struct cpu_apply
{ {
apply_map.at(it->name())(it); apply_map.at(it->name())(it);
} }
else if (is_context_free(it->get_operator())) else if(is_context_free(it->get_operator()))
{ {
apply_cpu_op(it); apply_cpu_op(it);
} }
......
...@@ -162,7 +162,7 @@ inline fused_operator_args make_fused_args() ...@@ -162,7 +162,7 @@ inline fused_operator_args make_fused_args()
return make_obj<fused_operator_args>(&miopenCreateOperatorArgs); return make_obj<fused_operator_args>(&miopenCreateOperatorArgs);
} }
template<class F> template <class F>
auto reflect(miopenActivationDescriptor_t ad, F f) auto reflect(miopenActivationDescriptor_t ad, F f)
{ {
miopenActivationMode_t mode; miopenActivationMode_t mode;
...@@ -173,15 +173,16 @@ auto reflect(miopenActivationDescriptor_t ad, F f) ...@@ -173,15 +173,16 @@ auto reflect(miopenActivationDescriptor_t ad, F f)
return pack(f(mode, "mode"), f(alpha, "alpha"), f(beta, "beta"), f(gamma, "gamma")); return pack(f(mode, "mode"), f(alpha, "alpha"), f(beta, "beta"), f(gamma, "gamma"));
} }
template<class F> template <class F>
auto reflect(miopenLRNDescriptor_t lrnd, F f) auto reflect(miopenLRNDescriptor_t lrnd, F f)
{ {
miopenLRNMode_t mode;; miopenLRNMode_t mode;
;
unsigned int n; unsigned int n;
double alpha; double alpha;
double beta; double beta;
double k; double k;
miopenGetLRNDescriptor(lrnd,&mode, &n, &alpha, &beta, &k); miopenGetLRNDescriptor(lrnd, &mode, &n, &alpha, &beta, &k);
return pack(f(mode, "mode"), f(n, "n"), f(alpha, "alpha"), f(beta, "beta"), f(k, "k")); return pack(f(mode, "mode"), f(n, "n"), f(alpha, "alpha"), f(beta, "beta"), f(k, "k"));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment