1 #ifndef JPSBQEEADUPURARCCBVXOLXVMQHTNWCQWXUKKHCOTWFGOGXSODKEEYLSSTFGTVXNBROLKKEJM
2 #define JPSBQEEADUPURARCCBVXOLXVMQHTNWCQWXUKKHCOTWFGOGXSODKEEYLSSTFGTVXNBROLKKEJM
6 #include "./utils/better_assert.hpp"
7 #include "./utils/debug.hpp"
8 #include "./utils/id.hpp"
9 #include "./utils/enable_shared.hpp"
10 #include "./utils/state.hpp"
15 template< Tensor Tsor >
22 template< Tensor Tsor >
23 struct place_holder : enable_id< place_holder<Tsor>, "PlaceHolder" >, enable_shared_state<place_holder<Tsor>, place_holder_state<Tsor>>
34 (*this).state_ = std::make_shared<place_holder_state<Tsor>>();
39 (*this).state_ = std::make_shared<place_holder_state<Tsor>>();
40 (*((*this).state_)).shape_hint_ = shape_hint;
45 better_assert( (*this).state_,
"Error with empty state." );
46 (*((*this).state_)).data_ = data;
51 better_assert( (*this).state_,
"Error with empty state." );
52 better_assert( !((*((*this).state_)).data_.empty()),
"Error with empty tensor." );
53 return (*((*this).state_)).data_;
61 template<
typename T >
64 template< Tensor Tsor >
70 template<
typename T >
73 template< Place_Holder Ph >
76 return lhs.id() == rhs.id();
79 template< Place_Holder Ph >
82 return lhs.id() != rhs.id();
85 template< Place_Holder Ph >
88 return lhs.id() < rhs.id();
91 template< Place_Holder Ph >
94 return lhs.id() < rhs.id();
97 template< Place_Holder Ph >
100 return lhs.id() <= rhs.id();
103 template< Place_Holder Ph >
106 return lhs.id() >= rhs.id();
Definition: activation.hpp:12
concept Place_Holder
Definition: place_holder.hpp:71
constexpr bool is_place_holder_v
Definition: place_holder.hpp:68
bool operator>(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:92
bool operator!=(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:80
bool operator<(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:86
bool operator>=(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:104
bool operator==(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:74
bool operator<=(Ph const &lhs, Ph const &rhs)
Definition: place_holder.hpp:98
Definition: place_holder.hpp:62
Definition: place_holder.hpp:17
std::vector< unsigned long > shape_hint_
Definition: place_holder.hpp:19
Tsor data_
Definition: place_holder.hpp:18
Definition: place_holder.hpp:24
place_holder()
Definition: place_holder.hpp:32
place_holder(place_holder const &other)=default
place_holder & operator=(place_holder const &other)=default
void bind(Tsor data)
Definition: place_holder.hpp:43
Tsor tensor_type
Definition: place_holder.hpp:25
Tsor const forward() const
Definition: place_holder.hpp:49
place_holder(std::vector< unsigned long > const &shape_hint)
Definition: place_holder.hpp:37
void backward(auto) const noexcept
Definition: place_holder.hpp:58
place_holder(place_holder &&other)=default
void reset()
Definition: place_holder.hpp:56