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

IConcatenationLayer2 is an optional interface implemented by layers that marks them as concatenation layers. More...

#include <nvneural/LayerTypes.h>

Inheritance diagram for nvneural::IConcatenationLayer2:
nvneural::IConcatenationLayer nvneural::IRefObject

Public Member Functions

virtual bool allInputsSupportDirectTensorWrites () const noexcept=0
 Tests whether all inputs to this layer can be replaced with direct writes. More...
 
virtual NeuralResult getTensorWriteOffset (const ILayer *pInput, std::size_t *pOffsetOut) const noexcept=0
 Retrieves the write offset for the specified layer if possible. More...
 
- Public Member Functions inherited from nvneural::IConcatenationLayer
virtual bool inputSupportsElision (size_t inputIndex, std::size_t *pElisionOffsetOut) const noexcept=0
 If this layer supports elision, it calculates the appropriate offset for a given input. 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 = 0x715eaa65a023d7bcul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IConcatenationLayer
static const IRefObject::TypeId typeID = 0xe4924aa3178a6e9ful
 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

IConcatenationLayer2 is an optional interface implemented by layers that marks them as concatenation layers.

This is a revised version of IConcatenationLayer that requires more checks for direct writes.

Null inputs always support direct writes, though sparse inputs are generally not recommended for concatenation. Layers cannot insert padding between inputs; relative execution order of layer inputs is not guaranteed. Layers cannot write into more than one location; concatenating a layer with itself is not supported. Layers must match the output format of the concatenation layer. Layers cannot be marked as permanent.

Output offsets must remain valid until the concatenation layer is reshaped.

Member Function Documentation

◆ allInputsSupportDirectTensorWrites()

virtual bool nvneural::IConcatenationLayer2::allInputsSupportDirectTensorWrites ( ) const
pure virtualnoexcept

Tests whether all inputs to this layer can be replaced with direct writes.

Returns
True if all inputs can be replaced with a direct write. False if even one cannot.

◆ getTensorWriteOffset()

virtual NeuralResult nvneural::IConcatenationLayer2::getTensorWriteOffset ( const ILayer pInput,
std::size_t *  pOffsetOut 
) const
pure virtualnoexcept

Retrieves the write offset for the specified layer if possible.

If the provided layer is not an input of this layer, or concatenation of the provided layer cannot be performed by allocating a linear span of this layer's output tensor memory as the provided layer's own output, then this function returns a failure result and sets the output offset to zero.

If the layer does support direct tensor writes, returns success and sets the output offset.

Parameters
pInputLayer that is an input to this concatenation layer
pOffsetOutVariable receiving an offset to this layer's tensor memory

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