Commit ca33154a authored by Khalique's avatar Khalique
Browse files

added reflect function to operators

parent 1dcf8e25
...@@ -234,10 +234,11 @@ struct leaky_relu ...@@ -234,10 +234,11 @@ struct leaky_relu
check_shapes{inputs, *this}.has(1); check_shapes{inputs, *this}.has(1);
return inputs.front(); return inputs.front();
} }
friend std::ostream& operator<<(std::ostream& os, const leaky_relu& op)
template <class Self, class F>
static auto reflect(Self& self, F f)
{ {
os << op.name() << ":" << op.alpha; return pack(f(self.alpha, "alpha"));
return os;
} }
}; };
...@@ -250,10 +251,11 @@ struct elu ...@@ -250,10 +251,11 @@ struct elu
check_shapes{inputs, *this}.has(1); check_shapes{inputs, *this}.has(1);
return inputs.front(); return inputs.front();
} }
friend std::ostream& operator<<(std::ostream& os, const elu& op)
template <class Self, class F>
static auto reflect(Self& self, F f)
{ {
os << op.name() << ":" << op.alpha; return pack(f(self.alpha, "alpha"));
return os;
} }
}; };
......
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