26 #ifndef NVNEURAL_NETWORKLAYER_H
27 #define NVNEURAL_NETWORKLAYER_H
75 refobj::Implements<BaseLayer>
76 , refobj::IndirectlyImplements<ILayer, BaseLayer>
77 , refobj::Implements<INetworkLayer>
78 , refobj::Implements<IRuntimeOptionsLayer>>
81 static const char*
const ObjectClass;
85 const char* serializedType()
const noexcept
override;
96 NeuralResult setPermanent(
bool permanent) noexcept
override;
98 NeuralResult setAffected(
bool affected) noexcept
override;
105 NeuralResult getCpuConstData(
void* pOutBuffer,
size_t bufferByteCount,
size_t* pBytesCopied,
TensorFormat format)
const noexcept
override;
108 NeuralResult getFlattenSubNetworkLayerList(
ILayerList** ppLayerList,
size_t* pDepth)
const noexcept
override;
109 NeuralResult addFusingRuleToSubNetwork(
const char* pFusingRule) noexcept
override;
113 std::size_t runtimeOptionCount()
const noexcept
override;
114 const char* runtimeOptionByIndex(
size_t index)
const noexcept
override;
116 NeuralResult setRuntimeOptionValue(
const char* pName,
const char* pValue) noexcept
override;
117 const char* getRuntimeOptionValue(
const char* pName)
const noexcept
override;
120 struct InputConnection
122 InputConnection(
int index,
ILayer* pLayer)
134 std::string m_weightPath;
136 std::map<ILayer*, std::vector<InputConnection>> m_inputConnectionMap;
138 std::vector<ILayer*> m_inputs;
139 std::vector<ILayer*> m_outputs;
140 std::vector<ILayer*> m_reshapeLayer;
142 std::vector<std::string> m_fusingRules;
Generic helper class to aid implementation of new ILayer objects.
Fundamental NvNeural data types are declared here.
NetworkBackendId
Enumeration describing common network backends.
Definition: CoreTypes.h:239
NeuralResult
NeuralResult is a generic success/failure result type similar to COM HRESULT.
Definition: CoreTypes.h:275
Interface types needed by layer objects.
Host application types for network construction and manipulation.
ILayer is the base class for neural network layers.
Definition: LayerTypes.h:59
ILayerList represents an immutable collection of ILayer pointers.
Definition: CoreTypes.h:1060
INetworkLayer objects are ILayers that encapsulate an externally defined network graph.
Definition: NetworkLayer.h:42
virtual NeuralResult getFlattenSubNetworkLayerList(ILayerList **ppLayerList, size_t *pDepth) const noexcept=0
Returns a recursively flattened list of layers contained in the subgraph.
virtual NeuralResult addFusingRuleToSubNetwork(const char *pFusingRule) noexcept=0
Adds a v2 fusing rule to the subgraph's network builder object.
static const IRefObject::TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: NetworkLayer.h:45
virtual NeuralResult getOutputs(ILayerList **ppLayerList) const noexcept=0
Returns a list of output layers defined in the subgraph.
INetworkRuntime is a subset of the basic network interface that is accessible from layer classes duri...
Definition: CoreTypes.h:1129
Represents a serialized parameter block in a model definition.
Definition: CoreTypes.h:1889
Base class for all objects, similar to COM's IUnknown.
Definition: CoreTypes.h:343
std::uint64_t TypeId
Every interface must define a unique TypeId. This should be randomized.
Definition: CoreTypes.h:349
IRuntimeOptionsHost is an interface that provides runtime option communication from the layer to the ...
Definition: CoreTypes.h:544
Intrusive pointer using IRefObject's reference counting system.
Definition: RefPtr.h:46
TensorDimension describes the dimensions of a four-dimensional image tensor.
Definition: CoreTypes.h:136
Parameterized base class implementing common IRefObject operations.
Definition: RefObject.h:336