NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::StringMapParameterNode Class Referencefinal

IParameterNode implementation designed to demonstrate loading parameters outside the standard nv-neural-model XML file format. More...

#include <StringMapParameterNode.h>

Inheritance diagram for nvneural::StringMapParameterNode:
nvneural::refobj::RefObjectBase< refobj::Implements< IParameterNode > >

Public Types

using StringMap = std::map< std::string, std::string >
 Shorthand typedef for string->string maps.
 

Public Member Functions

NeuralResult getDimension (const char *pParameterName, TensorDimension *pDimOut) const noexcept
 Retrieves a tensor dimension. More...
 
NeuralResult getFloat (const char *pParameterName, float *pFloatOut) const noexcept
 Retrieves a floating-point value. More...
 
NeuralResult getInteger (const char *pParameterName, int32_t *pIntOut) const noexcept
 Retrieves a signed integer value. More...
 
NeuralResult getSize (const char *pParameterName, size_t *pSizeOut) const noexcept
 Retrieves an unsigned integer value that can represent the result of sizeof(). More...
 
NeuralResult getString (const char *pParameterName, const char **pStringOut) const noexcept
 Retrieves a UTF-8 string value. More...
 
NeuralResult setDimension (const char *pParameterName, TensorDimension value) noexcept
 Saves a tensor dimension. More...
 
NeuralResult setFloat (const char *pParameterName, float value) noexcept
 Saves a floating-point value. More...
 
NeuralResult setInteger (const char *pParameterName, int32_t value) noexcept
 Saves an integer. More...
 
NeuralResult setSize (const char *pParameterName, size_t value) noexcept
 Saves an unsigned integer that can represent the result of sizeof(). More...
 
NeuralResult setString (const char *pParameterName, const char *pString) noexcept
 Saves a UTF-8 string value. More...
 
 StringMapParameterNode (const StringMap &stringMap)
 Creates a StringMapParameterNode from a map of <parameterName, parameterValue> pairs.
 
 StringMapParameterNode (StringMap &&stringMap)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
- Public Member Functions inherited from nvneural::refobj::RefObjectBase< refobj::Implements< IParameterNode > >
IRefObject::RefCount addRef () const noexcept
 Increment the object's reference count. More...
 
const void * queryInterface (IRefObject::TypeId interfaceId) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void * queryInterface (IRefObject::TypeId interfaceId) noexcept
 Retrieves a new object interface pointer. More...
 
 RefObjectBase ()
 Default constructor. Logs object creation.
 
IRefObject::RefCount release () const noexcept
 Decrements the object's reference count and destroys the object if the reference count reaches zero. More...
 

Detailed Description

IParameterNode implementation designed to demonstrate loading parameters outside the standard nv-neural-model XML file format.

Used as a fallback during code generation.

This class is ABI-stable through the IParameterNode interface, but the constructor relies on C++ standard container types and should not be called with a StringMap from another loaded module.

Member Function Documentation

◆ getDimension()

NeuralResult StringMapParameterNode::getDimension ( const char *  pParameterName,
TensorDimension pDimOut 
) const
noexcept

Retrieves a tensor dimension.

Tensor dimensions are stored as strings, and parsed using TensorDimensionToString as described in CoreHelpers.h. The IMAGE mode is used for parsing; use getString and parse manually if you require tensor ordering. Almost all persisted dimensions in existing networks are parsed using IMAGE mode; when porting Creo Neural code, this is probably what you need.

Parameters
pParameterNameName of parameter to query
pDimOutPointer to a variable receiving the parameter value

◆ getFloat()

NeuralResult StringMapParameterNode::getFloat ( const char *  pParameterName,
float *  pFloatOut 
) const
noexcept

Retrieves a floating-point value.

Parameters
pParameterNameName of parameter to query
pFloatOutPointer to a variable receiving the parameter value.

◆ getInteger()

NeuralResult StringMapParameterNode::getInteger ( const char *  pParameterName,
int32_t *  pIntOut 
) const
noexcept

Retrieves a signed integer value.

Parameters
pParameterNameName of parameter to query
pIntOutPointer to a variable receiving the parameter value.

◆ getSize()

NeuralResult StringMapParameterNode::getSize ( const char *  pParameterName,
size_t *  pSizeOut 
) const
noexcept

Retrieves an unsigned integer value that can represent the result of sizeof().

Parameters
pParameterNameName of parameter to query
pSizeOutPointer to a variable receiving the parameter value.

◆ getString()

NeuralResult StringMapParameterNode::getString ( const char *  pParameterName,
const char **  pStringOut 
) const
noexcept

Retrieves a UTF-8 string value.

Parameters
pParameterNameName of parameter to query
pStringOutPointer to a variable receiving the parameter value.

◆ setDimension()

NeuralResult StringMapParameterNode::setDimension ( const char *  pParameterName,
TensorDimension  value 
)
noexcept

Saves a tensor dimension.

Parameters
pParameterNameName of parameter to set
valueValue to save

◆ setFloat()

NeuralResult StringMapParameterNode::setFloat ( const char *  pParameterName,
float  value 
)
noexcept

Saves a floating-point value.

Parameters
pParameterNameName of parameter to set
valueValue to save

◆ setInteger()

NeuralResult StringMapParameterNode::setInteger ( const char *  pParameterName,
int32_t  value 
)
noexcept

Saves an integer.

Parameters
pParameterNameName of parameter to set
valueValue to save

◆ setSize()

NeuralResult StringMapParameterNode::setSize ( const char *  pParameterName,
size_t  value 
)
noexcept

Saves an unsigned integer that can represent the result of sizeof().

Parameters
pParameterNameName of parameter to set
valueValue to save

◆ setString()

NeuralResult StringMapParameterNode::setString ( const char *  pParameterName,
const char *  pString 
)
noexcept

Saves a UTF-8 string value.

Parameters
pParameterNameName of parameter to set
pStringValue to save

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