/
vuron
/
adept
Обзор
Документация
Войти
/
vuron
/
adept
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
with_cpu
src/dispatch/nll_loss.hpp
19 строк
666 B
kolkir
Refactor Shape class
19 янв 2025, 13:34
19 янв 2025, 13:34
58ce2e9
Код
Авторство
О чём код?
#pragma once #include <adept/dispatch/dispatcher.hpp> #include <adept/tensor.hpp> namespace adept { inline Tensor nll_loss_fwd(const Tensor& log_props, const Tensor& target) { static auto& func = Dispatcher::instance().find("nll_loss_fwd"); return Dispatcher::instance().call<Tensor, const Tensor&, const Tensor&>(func, log_props, target); } inline Tensor nll_loss_bwd(const Tensor& target, const Tensor& out_grad, index_t num_classes) { static auto& func = Dispatcher::instance().find("nll_loss_bwd"); return Dispatcher::instance().call<Tensor, const Tensor&, const Tensor&, index_t>( func, target, out_grad, num_classes); } } // namespace adept