04 2022 档案

摘要:本文将用一个小的示例来展示如何通过Boost.Python 来实现 C++/Python 混合编程从而将两种语言的优势整合到一起。 1. CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(test_boost_python LANG 阅读全文
posted @ 2022-04-23 20:40 Fitanium 阅读(1288) 评论(0) 推荐(0)
摘要:1. CMAKE_PREFIX_PATH CMAKE_PREFIX_PATH是一个分号分隔的路径列表,用来指明软件/库安装路径前缀,以供find_package(),find_program(),find_library(),find_file()和find_path()命令搜索使用,这样就方便搜索 阅读全文
posted @ 2022-04-23 10:19 Fitanium 阅读(22939) 评论(0) 推荐(1)
摘要:C++ unordered_map 使用自定义类作为键类型 C++ unordered_map using a custom class type as the key 阅读全文
posted @ 2022-04-19 08:50 Fitanium 阅读(152) 评论(0) 推荐(0)
摘要:得益于反向传播算法,神经网络计算导数时非常方便,下面代码中演示如何使用LibTorch进行自动微分求导。 进行自动微分运算需要调用函数 torch::autograd::grad( outputs, // 为某个可微函数的输出 y=f(x) 中的 y inputs, // 为某个可微函数的输入 y= 阅读全文
posted @ 2022-04-17 15:00 Fitanium 阅读(402) 评论(0) 推荐(1)