8 #ifndef BLACKCAT_TENSORS_LAYER_TRAITS_H_ 9 #define BLACKCAT_TENSORS_LAYER_TRAITS_H_ 60 typename system_tag::default_floating_point_type>;
101 template<
class... Args>
105 bc::traits::is_detected_v<
107 return select_on_predict(detected(), layer, std::forward<Args>(args)...);
110 template<
class... Args>
114 bc::traits::is_detected_v<
116 return select_on_single_predict(detected(), layer, std::forward<Args>(args)...);
122 template<
class... Args>
123 static auto select_on_predict(std::true_type, T& layer, Args&&... args) {
124 return layer.predict(args...);
127 template<
class... Args>
128 static auto select_on_predict(std::false_type, T& layer, Args&&... args) {
129 return layer.forward_propagation(args...);
132 template<
class... Args>
133 static auto select_on_single_predict(std::true_type, T& layer, Args&&... args) {
134 return layer.single_predict(args...);
137 template<
class... Args>
138 static auto select_on_single_predict(std::false_type, T& layer, Args&&... args) {
139 return select_on_predict(layer, args...);
typename T::greedy_evaluate_delta query_greedy_evaluate_delta
Definition: layer_traits.h:23
bc::traits::conditional_detected_t< detail::query_backward_requires_outputs, T, std::false_type > backward_delta_should_be_cached
Definition: layer_traits.h:92
Definition: constexpr_int.h:14
bc::traits::conditional_detected_t< detail::query_greedy_evaluate_delta, T, std::false_type > greedy_evaluate_delta
Definition: layer_traits.h:98
Definition: type_traits.h:190
typename T::backward_requires_extra_cache query_backward_requires_extra_cache
Definition: layer_traits.h:20
typename T::backward_requires_inputs query_backward_requires_inputs
Definition: layer_traits.h:18
bc::traits::conditional_detected_t< bc::traits::query_value_type, T, typename system_tag::default_floating_point_type > value_type
Definition: layer_traits.h:60
typename T::input_tensor_dim query_input_tensor_dim
Definition: layer_traits.h:21
typename T::system_tag system_tag
Layers have the function: backward_propagate(Args...); – The arguments supplied are based upon these...
Definition: layer_traits.h:55
typename T::requires_extra_cache query_requires_extra_cache
Definition: layer_traits.h:30
Definition: layer_traits.h:42
bc::traits::conditional_detected_t< detail::query_forward_requires_extra_cache, T, std::false_type > forward_requires_extra_cache
Definition: layer_traits.h:83
typename T::defines_predict query_defines_predict
Definition: layer_traits.h:37
typename T::extra_batched_cache_args query_extra_batched_cache_args
Definition: layer_traits.h:31
bc::traits::conditional_detected_t< detail::query_forward_requires_outputs, T, std::false_type > forward_requires_outputs
Definition: layer_traits.h:80
typename T::backward_requires_outputs query_backward_requires_outputs
Definition: layer_traits.h:19
bc::traits::conditional_detected_t< bc::traits::query_allocator_type, T, bc::Allocator< value_type, system_tag > > allocator_type
Definition: layer_traits.h:65
typename T::value_type query_value_type
Definition: type_traits.h:173
typename T::output_tensor_dim query_output_tensor_dim
Definition: layer_traits.h:22
typename T::defines_single_predict query_defines_single_predict
Definition: layer_traits.h:34
typename T::forward_requires_extra_cache query_forward_requires_extra_cache
Definition: layer_traits.h:17
bc::traits::conditional_detected_t< detail::query_requires_extra_cache, T, std::false_type > requires_extra_cache
Definition: layer_traits.h:68
Definition: allocators.h:20
bc::traits::conditional_detected_t< detail::query_backward_requires_extra_cache, T, std::false_type > backward_requires_extra_cache
Definition: layer_traits.h:95
typename conditional_detected< func, TestType, DefaultType >::type conditional_detected_t
Definition: type_traits.h:87
typename T::forward_requires_outputs query_forward_requires_outputs
Definition: layer_traits.h:16
bc::traits::conditional_detected_t< detail::query_output_tensor_dim, T, input_tensor_dim > output_tensor_dim
Definition: layer_traits.h:74
static auto select_on_single_predict(T &layer, Args &&... args)
Definition: layer_traits.h:111
bc::traits::conditional_detected_t< detail::query_forward_requires_inputs, T, std::true_type > forward_requires_inputs
Definition: layer_traits.h:77
typename T::forward_requires_inputs query_forward_requires_inputs
Definition: layer_traits.h:15
conditional_t< Bool, true_type, false_type > truth_type
Definition: type_traits.h:49
static auto select_on_predict(T &layer, Args &&... args)
Definition: layer_traits.h:102
bc::traits::conditional_detected_t< detail::query_input_tensor_dim, T, bc::traits::Integer< 1 > > input_tensor_dim
Definition: layer_traits.h:71
bc::traits::conditional_detected_t< detail::query_backward_requires_inputs, T, std::true_type > backward_requires_inputs
Definition: layer_traits.h:86
bc::traits::conditional_detected_t< detail::query_backward_requires_outputs, T, std::false_type > backward_requires_outputs
Definition: layer_traits.h:89
typename T::query_backwards_delta_should_be_cached query_backwards_delta_should_be_cached
Definition: layer_traits.h:28
typename T::allocator_type query_allocator_type
Definition: type_traits.h:176
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22