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

INetwork2 is the public interface for the revision 2 of the Network interface. More...

#include <nvneural/NetworkTypes.h>

Inheritance diagram for nvneural::INetwork2:
nvneural::INetwork nvneural::INetworkRuntime nvneural::IRefObject nvneural::INetwork3

Public Member Functions

virtual NeuralResult pushLayer (ILayer *pLayer) noexcept=0
 Adds a layer to the network. More...
 
virtual NeuralResult pushLayer (ILayer *pLayer, const char *pTemplateParentName) noexcept=0
 Adds a layer to the network. More...
 
- Public Member Functions inherited from nvneural::INetwork
virtual NeuralResult attachNetworkDebugger (INetworkDebugger *pDebugger) noexcept=0
 Attaches a debugger object to the network. More...
 
virtual NeuralResult attachReshapeDebugger (INetworkReshapeDebugger *pDebugger) noexcept=0
 Attaches a reshape debugger object to the network. More...
 
virtual NeuralResult bindCurrentThread () noexcept=0
 Binds the network to the current thread. More...
 
virtual NeuralResult clearLayers () noexcept=0
 Releases all layers from the network.
 
virtual NeuralResult clearLoadedWeights () noexcept=0
 Clears the cache of loaded weights. More...
 
virtual NeuralResult copyTensor (const ILayer *pSourceLayer, ILayer *pDestinationLayer) noexcept=0
 Copy the output tensor from one layer to another.
 
virtual IActivationFunctiondefaultForwardActivationFunction (const ILayer *pLayer) const noexcept=0
 Retrieves the activation function consumed by defaultForwardActivation. More...
 
virtual NeuralResult detachAllNetworkDebuggers () noexcept=0
 Detaches all debuggers from the network.
 
virtual NeuralResult detachAllReshapeDebuggers () noexcept=0
 Detaches all reshape debuggers from the network.
 
virtual NeuralResult detachNetworkDebugger (const INetworkDebugger *pDebugger) noexcept=0
 Detaches a debugger object from the network.
 
virtual NeuralResult detachReshapeDebugger (const INetworkReshapeDebugger *pDebugger) noexcept=0
 Detaches a debugger object from the network.
 
virtual const IClassRegistrygetClassRegistry () const noexcept=0
 Get the IClassRegistry used by the network.
 
virtual NeuralResult getNetworkDebuggers (INetworkDebuggerList **ppListOut) const noexcept=0
 Retrieves the list of attached network debuggers. More...
 
virtual NeuralResult getProcessedLayerInputList (const ILayer *pLayer, ILayerList **ppProcessedInputLayerList) const noexcept=0
 Get a layer input list and preprocess it to replace any inner NetworkLayer's layer by the NetworkLayer itself. More...
 
virtual NeuralResult getWeightsNamesForLayer (IStringList **ppListOut, const ILayer *pLayer) const noexcept=0
 Retrieves a list of weights consumed by a layer. More...
 
virtual NeuralResult setClassRegistry (const IClassRegistry *pRegistry) noexcept=0
 Set an IClassRegistry object to this network. More...
 
virtual NeuralResult synchronize () noexcept=0
 Performs a CPU/GPU sync and completes pending operations.
 
virtual NeuralResult unload () noexcept=0
 Releases member data and theoretically breaks cycles between Networks/Layers not using weak references. More...
 
virtual NeuralResult attachBackend (INetworkBackend *pBackend) noexcept=0
 Attaches a backend to the network. More...
 
virtual NeuralResult setDefaultBackendId (NetworkBackendId backendId) noexcept=0
 Sets the default backend for the network. More...
 
virtual NeuralResult setDefaultTensorFormat (const TensorFormat &tensorFormat) noexcept=0
 Sets the default tensor format for the network.
 
virtual NeuralResult setNetworkName (const char *pName) noexcept=0
 Sets the name for the network. More...
 
virtual NeuralResult setOptimizationFlag (NetworkBackendId backendId, INetworkBackend::OptimizationCapability capability, bool enabled) noexcept=0
 Sets if the indicated optimization is applicable to the passed backend.
 
virtual bool isOptimizationFlagEnabled (NetworkBackendId backendId, INetworkBackend::OptimizationCapability capability) const noexcept=0
 Gets if the indicated optimization is enabled to the passed backend.
 
virtual NeuralResult setWeightsLoader (IWeightsLoader *pWeightsLoader) noexcept=0
 Sets the weights loader for the network. More...
 
virtual NeuralResult pushLayer (ILayer *pLayer) noexcept=0
 Adds a layer to the network. More...
 
virtual NeuralResult pushLayerAlias (const char *pAliasName, ILayer *pLayer) noexcept=0
 Adds an alias for a layer. More...
 
virtual NeuralResult reshapeAll () noexcept=0
 Reshapes the entire network.
 
virtual NeuralResult reshape (ILayerList *pMarkedLayers) noexcept=0
 Reshapes a subgraph. More...
 
virtual NeuralResult inferenceSubgraph (ILayerList *pInputs, ILayerList *pOutputs) noexcept=0
 Performs inference across a subgraph. More...
 
virtual NeuralResult inference () noexcept=0
 Performs inference on the network. More...
 
- Public Member Functions inherited from nvneural::INetworkRuntime
virtual NetworkBackendId defaultBackendId () const noexcept=0
 Retrieves the default backend ID used by the network.
 
virtual NeuralResult defaultForwardActivation (ILayer *pLayer) const noexcept=0
 Perform generic forward activation. More...
 
virtual TensorFormat defaultTensorFormat () const noexcept=0
 Retrieves the default tensor format used by the network.
 
virtual const INetworkBackendgetBackend (NetworkBackendId backendId) 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 INetworkBackendgetBackend (NetworkBackendId backendId) noexcept=0
 Retrieves an installed network backend. More...
 
virtual void * getInternalTensor (const ILayer *pLayer, NetworkBackendId backendId) noexcept=0
 Retrieves internal tensor data for a layer. More...
 
virtual TensorDimension getLayerInternalDimensions (const ILayer *pLayer) const noexcept=0
 Retrieves the internal dimensions of a layer. More...
 
virtual void * getTensor (const ILayer *pDataLayer, const ILayer *pRequestingLayer, TensorFormat format) noexcept=0
 Retrieves tensor data from one layer on behalf of another. More...
 
virtual NeuralResult getWeightsDimensionForLayer (TensorDimension *pDimensionsOut, const ILayer *pLayer, const char *pWeightsName, NetworkBackendId backendId, TensorFormat format) noexcept=0
 Retrieves the dimensions of specific weights data for a layer. More...
 
virtual const void * getWeightsForLayer (const ILayer *pLayer, const char *pWeightsName, NetworkBackendId backendId, TensorFormat format) noexcept=0
 Retrieves specific weights data for a layer. More...
 
virtual NeuralResult mapLayerAsWeightsData (const ILayer *pDataLayer, const ILayer *pWeightsLayer, const char *pWeightsName) noexcept=0
 Maps a layer as a source of weights data for another layer. More...
 
virtual const char * networkName () const noexcept=0
 Retrieves the name of this network as a UTF-8 string.
 
virtual NeuralResult reshapeLater (ILayer *pLayer) noexcept=0
 Queues a layer for later reshape. More...
 
virtual NeuralResult setAffectedForward (ILayer *pLayer) noexcept=0
 Marks a layer and its descendants (those layers indirectly depending on it) as "affected.". More...
 
virtual IWeightsLoaderweightsLoader () const noexcept=0
 Retrieves the IWeightsLoader implementation for this network.
 
virtual size_t layerCount () const noexcept=0
 Gets the current number of layers in the network.
 
virtual ILayergetLayerByName (const char *pLayerName) const noexcept=0
 Retrieves a layer by name. More...
 
virtual NeuralResult getAllLayers (ILayerList **ppListOut) const noexcept=0
 Retrieves a list of layers present in the network. More...
 
virtual NeuralResult getInputLayers (ILayerList **ppListOut) const noexcept=0
 Retrieves a list of input layers present in the network. More...
 
virtual NeuralResult getOutputLayers (ILayerList **ppListOut) const noexcept=0
 Retrieves a list of output layers present in the network. More...
 
virtual NeuralResult getDependentLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0
 Retrieves a list of layers indirectly depending on pLayer. More...
 
virtual NeuralResult getAcceptorLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0
 Retrieves a list of layers directly depending on pLayer. More...
 
virtual NeuralResult getInfluenceLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0
 Retrieves a list of layers pLayer indirectly depends on. 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 = 0x18ab6a1edda6c965ul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::INetwork
static const IRefObject::TypeId typeID = 0x9ce8f71bf65288e9ul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::INetworkRuntime
static const IRefObject::TypeId typeID = 0x53191c073f990992ul
 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

INetwork2 is the public interface for the revision 2 of the Network interface.

Member Function Documentation

◆ pushLayer() [1/2]

virtual NeuralResult nvneural::INetwork::pushLayer
noexcept

Adds a layer to the network.

The layer is assumed to be fully constructed (all inputs hooked up, etc.).

◆ pushLayer() [2/2]

virtual NeuralResult nvneural::INetwork2::pushLayer ( ILayer pLayer,
const char *  pTemplateParentName 
)
pure virtualnoexcept

Adds a layer to the network.

The layer is assumed to be fully constructed (all inputs hooked up, etc.).

Parameters
pLayerthe layer instance to add to the network
pTemplateParentNamename of the template this layer was inlined from, use nullptr if not part of any template

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