|
| | Layer () |
| |
| | Layer (const LayerParams ¶ms) |
| | 初次只初始化 name、type 以及 blobs 字段。
|
| |
| virtual | ~Layer () |
| |
| virtual void | applyHalideScheduler (Ptr< BackendNode > &node, const std::vector< Mat * > &inputs, const std::vector< Mat > &outputs, int targetId) const |
| | 根据层的超参数自动进行 Halide 调度。
|
| |
| virtual void | finalize (const std::vector< Mat * > &input, std::vector< Mat > &output) |
| | 根据输入、输出和blob设置内部参数。
|
| |
| std::vector< Mat > | finalize (const std::vector< Mat > &inputs) |
| | 这是一个方便提供的重载成员函数。它与其他函数不同的地方在于它接受的参数。
|
| |
| void | finalize (const std::vector< Mat > &inputs, std::vector< Mat > &outputs) |
| | 这是一个方便提供的重载成员函数。它与其他函数不同的地方在于它接受的参数。
|
| |
| virtual void | finalize (InputArrayOfArrays inputs, OutputArrayOfArrays outputs) |
| | 根据输入、输出和blob设置内部参数。
|
| |
| virtual void | forward (InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals) |
| | 给定输入 blob,计算输出 blob。
|
| |
| virtual void | forward (std::vector< Mat * > &input, std::vector< Mat > &output, std::vector< Mat > &internals) |
| | 给定输入 blob,计算输出 blob。
|
| |
| void | forward_fallback (InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals) |
| | 给定输入 blob,计算输出 blob。
|
| |
| virtual int64 | getFLOPS (const std::vector< MatShape > &inputs, const std::vector< MatShape > &outputs) const |
| |
| virtual bool | getMemoryShapes (const std::vector< MatShape > &inputs, const int requiredOutputs, std::vector< MatShape > &outputs, std::vector< MatShape > &internals) const |
| |
| virtual void | getScaleShift (Mat &scale, Mat &shift) const |
| | 返回具有通道乘法和加法的层参数。
|
| |
| virtual void | getScaleZeropoint (float &scale, int &zeropoint) const |
| | 返回层的缩放和零点。
|
| |
| virtual Ptr< BackendNode > | initCann (const std::vector< PtrBackendWrapper > > &inputs, const std::vector< Ptr< BackendWrapper > > &outputs, const std::vector< PtrBackendNode > > &nodes) |
| | 返回一个 CANN 后端节点。
|
| |
| virtual Ptr< BackendNode > | initCUDA (void *context, const std::vector< Ptr< BackendWrapper > > &inputs, const std::vector< Ptr< BackendWrapper > > &outputs) |
| | 返回一个CUDA后端节点。
|
| |
| virtual Ptr< BackendNode > | initHalide (const std::vector< Ptr< BackendWrapper > > &inputs) |
| | 返回Halide后端节点。
|
| |
| virtual Ptr< BackendNode > | initNgraph (const std::vector< Ptr< BackendWrapper > > &inputs, const std::vector< Ptr< BackendNode > > &nodes) |
| |
| virtual Ptr< BackendNode > | initTimVX (void *timVxInfo, const std::vector< Ptr< BackendWrapper > > &inputsWrapper, const std::vector< Ptr< BackendWrapper > > &outputsWrapper, bool isLast) |
| | 返回一个TimVX后端节点。
|
| |
| virtual Ptr< BackendNode > | initVkCom (const std::vector< Ptr< BackendWrapper > > &inputs, std::vector< Ptr< BackendWrapper > > &outputs) |
| |
| virtual Ptr< BackendNode > | initWebnn (const std::vector< Ptr< BackendWrapper > > &inputs, const std::vector< Ptr< BackendNode > > &nodes) |
| |
| virtual int | inputNameToIndex (String inputName) |
| | 返回输入blob在输入数组中的索引。
|
| |
| virtual int | outputNameToIndex (const String &outputName) |
| | 返回输出blob在输出数组中的索引。
|
| |
| void | run (const std::vector< Mat > &inputs, std::vector< Mat > &outputs, std::vector< Mat > &internals) |
| | 分配层并计算输出。
|
| |
| virtual bool | setActivation (const Ptr< ActivationLayer > &layer) |
| | 尝试将后续激活层附加到层上,即在局部情况下进行层融合。
|
| |
| void | setParamsFrom (const LayerParams ¶ms) |
| | 初次只初始化 name、type 以及 blobs 字段。
|
| |
| virtual bool | supportBackend (int backendId) |
| | 询问层是否支持特定后端进行计算。
|
| |
| virtual Ptr< BackendNode > | tryAttach (const Ptr< BackendNode > &node) |
| | 实现层融合。
|
| |
| virtual bool | tryFuse (Ptr< Layer > &top) |
| | 尝试将当前层与下一层融合。
|
| |
| virtual bool | tryQuantize (const std::vector< std::vector< float > > &scales, const std::vector< std::vector< int > > &zeropoints, LayerParams ¶ms) |
| | 尝试量化给定的层,并计算固定点实现所需的量化参数。
|
| |
| virtual void | unsetAttached () |
| | "断开"特定层的所有层。
|
| |
| virtual bool | updateMemoryShapes (const std::vector< MatShape > &inputs) |
| |
| | Algorithm () |
| |
| virtual | ~Algorithm () |
| |
| virtual void | clear () |
| | 清除算法状态。
|
| |
| virtual bool | empty () const |
| | 如果 Algorithm 为空(例如,在非常开始或读取失败后),则返回 true。
|
| |
| virtual String | getDefaultName () const |
| |
| virtual void | read (const FileNode &fn) |
| | 从文件存储中读取算法参数。
|
| |
| virtual void | save (const String &filename) const |
| |
| void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
| |
| virtual void | write (FileStorage &fs) const |
| | 将算法参数存储在文件存储中。
|
| |
| void | write (FileStorage &fs, const String &name) const |
| |
| std::vector< size_t > | adjust_pads |
| |
| Size | adjustPad |
| |
| Size | dilation |
| |
| std::vector< size_t > | dilations |
| |
| Size | kernel |
| |
| std::vector< size_t > | kernel_size |
| |
| int | numOutput |
| |
| Size | pad |
| |
| String | padMode |
| |
| std::vector< size_t > | pads_begin |
| |
| std::vector< size_t > | pads_end |
| |
| Size | stride |
| |
| std::vector< size_t > | strides |
| |
| std::vector< Mat > | blobs |
| | 必须在此处存储学习参数列表,以便可以使用 Net::getParam() 进行读取。
|
| |
| String | name |
| | 层的实例名称,可用于日志记录或其他内部目的。
|
| |
| int | preferableTarget |
| | 选择层前向传播的目标
|
| |
| String | type |
| | 由层工厂创建层时使用的类型名称。
|
| |
| void | writeFormat (FileStorage &fs) const |
| |