NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::IPrototypeLayer Class Referenceabstract

IPrototypeLayer is an optional interface that marks a layer as a prototype layer. More...

#include <nvneural/layers/IPrototypeLayer.h>

Inheritance diagram for nvneural::IPrototypeLayer:
nvneural::IRefObject

Public Member Functions

virtual NeuralResult addForwardEvalCall (const char *pName, const char *pCall) noexcept=0
 Adds a call script for a particular tensor format and backend. More...
 
virtual NeuralResult addParameterKey (const char *pKey) noexcept=0
 Adds a named parameter to the layer. More...
 
virtual NeuralResult addPrototypeCode (const char *pName, const char *pCode) noexcept=0
 Adds a kernel definition for a particular tensor format and backend. More...
 
virtual NeuralResult loadPrototypeInfo (const IParameterNode *pParameters) noexcept=0
 Loads prototype definitions from a parameter node. More...
 
virtual NeuralResult setPrototypeInfo (std::size_t inputsCount, const char *pType, NetworkBackendId backend, TensorFormat format, const char *pDim, const char *pImpl) noexcept=0
 Sets details of the prototype layer explicitly. More...
 
- Public Member Functions inherited from nvneural::IRefObject
virtual RefCount addRef () const noexcept=0
 Increments the object's reference count. More...
 
virtual const void * queryInterface (TypeId interface) const noexcept=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual void * queryInterface (TypeId interface) noexcept=0
 Retrieves a new object interface pointer. More...
 
virtual RefCount release () const noexcept=0
 Decrements the object's reference count and destroy the object if the reference count reaches zero. More...
 

Static Public Attributes

static const IRefObject::TypeId typeID = 0xb24d9c4a56a0c3f7ul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IRefObject
static const TypeId typeID = 0x14ecc3f9de638e1dul
 Interface TypeId for InterfaceOf purposes.
 

Additional Inherited Members

- Public Types inherited from nvneural::IRefObject
using RefCount = std::uint32_t
 Typedef used to track the number of active references to an object.
 
using TypeId = std::uint64_t
 Every interface must define a unique TypeId. This should be randomized.
 
- Protected Member Functions inherited from nvneural::IRefObject
virtual ~IRefObject ()=default
 A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
 

Detailed Description

IPrototypeLayer is an optional interface that marks a layer as a prototype layer.

Prototype layers carry layer inference code as part of the model definition; this interface allows network builders such as XmlNetworkBuilder to connect the layer to its implementation.

Member Function Documentation

◆ addForwardEvalCall()

virtual NeuralResult nvneural::IPrototypeLayer::addForwardEvalCall ( const char *  pName,
const char *  pCall 
)
pure virtualnoexcept

Adds a call script for a particular tensor format and backend.

Replaces previous definitions of that kernel.

Parameters
pNameName of the prototype (e.g., "cuda_fp32_nchw")
pCallCall script for the prototype

◆ addParameterKey()

virtual NeuralResult nvneural::IPrototypeLayer::addParameterKey ( const char *  pKey)
pure virtualnoexcept

Adds a named parameter to the layer.

Parameters
pKeyParameter name that should be included in kernel calls

◆ addPrototypeCode()

virtual NeuralResult nvneural::IPrototypeLayer::addPrototypeCode ( const char *  pName,
const char *  pCode 
)
pure virtualnoexcept

Adds a kernel definition for a particular tensor format and backend.

Replaces previous definitions of that kernel.

Parameters
pNameName of the prototype provided (e.g., "cuda_fp32_nchw")
pCodeKernel code for the prototype

◆ loadPrototypeInfo()

virtual NeuralResult nvneural::IPrototypeLayer::loadPrototypeInfo ( const IParameterNode pParameters)
pure virtualnoexcept

Loads prototype definitions from a parameter node.

This is not part of an XML <Parameters> declaration; see the definition of XmlNetworkBuilder for how parameters are packed into an IParameterNode for this call.

Network builders use loadPrototypeInfo; generated code will typically use the more fine-grained setPrototypeInfo and addThing functions.

Parameters
pParametersAttributes of the prototype layer

◆ setPrototypeInfo()

virtual NeuralResult nvneural::IPrototypeLayer::setPrototypeInfo ( std::size_t  inputsCount,
const char *  pType,
NetworkBackendId  backend,
TensorFormat  format,
const char *  pDim,
const char *  pImpl 
)
pure virtualnoexcept

Sets details of the prototype layer explicitly.

Parameters
inputsCountNumber of inputs provided to the layer
pTypeType string to report in ILayer::serializedType
backendNetwork backend ID to report in ILayer
formatTensor format to report in ILayer
pDimDimension script string
pImplImplementation type string

The documentation for this class was generated from the following file: