Exemple #1
0
    static callable make()
    {
        const callable self = functional::call<F>(ndt::type("(Any) -> Any"));

        for (const std::pair<const type_id_t, callable> &pair :
                callable::make_all<K, numeric_type_ids>(0)) {
            children[pair.first] = pair.second;
        }

        for (type_id_t i0 : dim_type_ids()) {
            const ndt::type child_tp = ndt::callable_type::make(
                                           self.get_type()->get_return_type(), ndt::type(i0));
            children[i0] = functional::elwise(child_tp, self);
        }

        return functional::multidispatch(self.get_array_type(), children,
                                         default_child);
    }
Exemple #2
0
nd::callable nd::functional::outer(const callable &child)
{
  return callable::make<outer_ck>(outer_make_type(child.get_type()), child, 0);
}