simple_tensor.h#
Defines
-
ONNX_LIGHT_DECLARE_TENSOR_ELEMENT_TYPE(CPP_TYPE, ENUM_VALUE)#
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when
lib_onnx_protouses hidden visibility by default.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace core
-
namespace runtime
Typedefs
-
using DataType = TensorProto::DataType#
DataType — alias for
TensorProto::DataType.Provides a short, namespace-local name for the upstream ONNX
TensorProto::DataTypeenumeration so backend test code can writeDataType::INT64instead of fully qualifying every reference.
-
using RawByteBuffer = std::vector<uint8_t, DefaultInitAllocator<uint8_t>>#
Byte storage that skips zero-initialisation on resize/allocation.
Functions
-
inline bool operator==(const std::vector<int64_t> &v, const Shape &s) noexcept#
Symmetric comparison:
std::vector<int64_t> == Shape.
-
inline bool operator!=(const std::vector<int64_t> &v, const Shape &s) noexcept#
Symmetric comparison:
std::vector<int64_t> != Shape.
-
Tensor MakeOutputTensor(int32_t data_type, const Shape &shape, size_t n_bytes, RawBufferAllocator *allocator)#
Creates an empty output tensor of
n_bytesbytes with the givendata_typeandshape.When
allocatoris non-null the byte buffer is acquired from it via :cpp:func:RawBufferAllocator::Allocateand the returned tensor is allocator-backed (has_allocation()returnstrue). Whenallocatoris null the tensor uses an inline :cpp:class:RawBufferofn_bytes. In both cases the buffer contents are left uninitialised: the caller is expected to fully overwrite the result, so no time is spent zero-filling the memory.- Parameters:
data_type – ONNX element type (a
TensorProto::DataTypeinteger).shape – Output shape.
n_bytes – Total byte size of the output buffer (
element_count × element_size).allocator – Optional allocator; may be
nullptr.
-
size_t ElementSize(int32_t dtype)#
Returns the size in bytes of one element of
dtype(aDataTypeinteger). Throwsstd::invalid_argumentfor unsupported types. Sub-byte packed dtypes (INT4/UINT4/INT2/UINT2) are not supported by this helper because they do not have a whole-byte per-element size; usePackedByteSizeinstead.
-
size_t PackedByteSize(int32_t dtype, int64_t element_count)#
Returns the storage size in bytes for
element_countelements ofdtype. Whole-byte dtypes returnelement_count * ElementSize(dtype); sub-byte packed dtypes pack 2 (INT4/UINT4) or 4 (INT2/UINT2) elements per byte andelement_countis rounded up to fill the trailing byte. Throwsstd::invalid_argumentfor unsupported types.
-
void FillValueInfo(const Tensor &tensor, ValueInfoProto &vi)#
Fills
viwith the type/shape information described bytensor.vi.nameis set totensor.name.
-
Tensor TensorFromProto(const TensorProto &tp, RawBufferAllocator *allocator = nullptr)#
Converts a
TensorPrototo a :cpp:class:Tensor.Supports all numeric data types stored either in the typed repeated fields (
float_data,int32_data,int64_data,double_data,uint64_data) or in the raw little-endianraw_datafield.STRINGtensors are read fromstring_data.The resulting
Tensor::nameis set fromtp.name(); the shape is taken fromtp.dims().For the typed-field path the byte buffer is acquired from
allocatorwhen it is non-null (the returned tensor is then allocator-backed); whenallocatoris null an inline :cpp:class:RawBufferis used. Theraw_datapath always returns a borrowed (zero-copy) view and ignoresallocator.- Parameters:
tp – The source
TensorProto.allocator – Optional allocator for the typed-field byte buffer; may be
nullptr.
- Throws:
std::invalid_argument – for unsupported
data_typevalues.- Returns:
A
Tensorwhose data matches the content oftp.
-
class AllocationHandle#
- #include <simple_tensor.h>
Owns one allocator-backed raw buffer and returns it exactly once.
The handle is move-only. Moving it transfers ownership without moving or copying the payload. Destruction and :cpp:func:
Resetreturn the buffer to its allocator; an empty or moved-from handle is a no-op.A handle may instead own an :cpp:class:
IOLease(see the lease-adopting constructor). Such a handle keeps its owning :cpp:class:IOArenaalive on its own, so it may outlive the :cpp:class:RuntimeContextthat produced it — making it suitable for ownership by a cross-boundary consumer such as a NumPy capsule. Its accessors describe the leased allocation exactly like a plain allocator-backed handle, but :cpp:func:Resetreturns the buffer through the lease rather than the allocator interface.Public Functions
-
AllocationHandle() noexcept#
-
AllocationHandle(RawBufferAllocator *owner, RawBuffer *buffer)#
-
AllocationHandle(RawBufferAllocator *owner, IOLease lease)#
Adopts an :cpp:class:
IOLeaseso the handle keeps its arena alive.- Parameters:
owner – The :cpp:class:
IOArenathat producedlease(reported by :cpp:func:owner).lease – A lease pinning the exported allocation. Its buffer, logical size, and retained capacity are captured by the handle.
-
~AllocationHandle()#
-
AllocationHandle(const AllocationHandle&) = delete#
-
AllocationHandle &operator=(const AllocationHandle&) = delete#
-
AllocationHandle(AllocationHandle &&other) noexcept#
-
AllocationHandle &operator=(AllocationHandle &&other) noexcept#
-
inline explicit operator bool() const noexcept#
Returns whether this handle owns an allocation.
-
inline RawBuffer *buffer() const noexcept#
Returns the owned buffer, or
nullptrfor an empty handle.
-
inline RawBufferAllocator *owner() const noexcept#
Returns the allocator that owns the buffer, or
nullptrwhen empty.
-
inline size_t logical_size() const noexcept#
Returns the logical byte size captured when the handle was created.
-
inline size_t retained_capacity() const noexcept#
Returns the retained byte capacity captured when the handle was created.
-
inline bool holds_lease() const noexcept#
Returns whether this handle keeps its arena alive through an :cpp:class:
IOLease(as opposed to a plain allocator reference).
-
RawBuffer *Release() noexcept#
Relinquishes ownership of an allocator-backed buffer without returning it to the allocator, and makes this handle empty.
Returns the previously owned buffer for a plain allocator-backed handle so the caller can take over its lifetime (for example to re-export it through an :cpp:class:
IOArenalease). A lease-backed handle owns no transferable raw buffer, so its lease is released to the arena andnullptris returned.
-
void Reset() noexcept#
Returns the allocation to its owner and makes this handle empty.
Private Members
-
RawBufferAllocator *owner_ = nullptr#
-
size_t logical_size_ = 0#
-
size_t retained_capacity_ = 0#
-
AllocationHandle() noexcept#
-
template<typename T, typename Allocator = std::allocator<T>>
class DefaultInitAllocator : public std::allocator<T># - #include <simple_tensor.h>
DefaultInitAllocator — allocator that default-initialises elements.
A drop-in
std::allocatorreplacement whose only difference is that a value-initialisation request with no arguments (as issued bystd::vector::resize(n)orstd::vector(n)) performs default initialisation instead. For a trivially constructible element type such asuint8_tthis leaves the newly created bytes uninitialised rather than zero-filling them, which avoids a needlessmemsetwhen the buffer will be fully overwritten (for example a kernel result). All other construction (with explicit arguments) behaves exactly likestd::allocator.Public Functions
-
DefaultInitAllocator() noexcept = default#
-
template<typename U, typename A>
inline explicit DefaultInitAllocator(const DefaultInitAllocator<U, A> &other) noexcept#
-
DefaultInitAllocator() noexcept = default#
-
struct RawBuffer#
- #include <simple_tensor.h>
RawBuffer — an owned byte buffer equivalent to
std::vector<uint8_t>.Wraps a
std::vector<uint8_t>(backed by :cpp:class:DefaultInitAllocator) under a dedicated type name to make the ownership semantics of raw element bytes explicit in theTensorstruct and to provide a natural extension point should the storage strategy change in the future. Because the backing allocator default-initialises, :cpp:func:resizeand the size constructor leave the fresh bytes uninitialised rather than zero-filling them.The full
std::vector<uint8_t>interface subset needed by the codebase is exposed:size,empty,data,begin/end, indexed access,assign, andresize. Implicit conversions to and fromstd::vector<uint8_t>are provided for backward compatibility.Public Functions
-
RawBuffer() = default#
-
inline explicit RawBuffer(size_t n)#
Constructs a buffer of
nbytes whose contents are left uninitialised.
-
inline RawBuffer(RawByteBuffer &&v) noexcept#
-
inline operator std::vector<uint8_t>() const#
Implicitly converts to
std::vector<uint8_t>for backward compatibility.
-
inline size_t size() const noexcept#
-
inline size_t capacity() const noexcept#
-
inline bool empty() const noexcept#
-
inline uint8_t *data() noexcept#
-
inline const uint8_t *data() const noexcept#
-
inline uint8_t &operator[](size_t i) noexcept#
-
inline const uint8_t &operator[](size_t i) const noexcept#
-
inline auto begin() noexcept#
-
inline auto end() noexcept#
-
inline auto begin() const noexcept#
-
inline auto end() const noexcept#
-
inline RawByteBuffer release() noexcept#
Moves the underlying byte storage out of the buffer, leaving it empty.
Returns the owned :cpp:type:
RawByteBufferby move so callers can take ownership of the bytes (for example to hand them to NumPy through a DLPack-style capsule) without copying. After the call the buffer is empty (size() == 0).
-
inline void assign(size_t count, uint8_t value)#
Fills the buffer with
countcopies ofvalue, resizing as needed.
-
template<typename InputIt>
inline void assign(InputIt first, InputIt last)# Replaces the buffer contents with the bytes from
[first, last).
-
inline void resize(size_t count)#
Resizes the buffer to
countbytes. Newly added bytes are left uninitialised (the backing allocator default-initialises), so callers must fully overwrite the buffer before reading it.
Private Members
-
RawByteBuffer storage_#
-
RawBuffer() = default#
-
struct Shape#
- #include <simple_tensor.h>
Shape — a fixed-capacity tensor shape storing up to 16 dimensions.
Stores dimension values in an inline
int64_t[kMaxRank]array so no heap allocation is required for ordinary shapes. The number of valid dimensions is tracked bysize_. An empty shape (size_ == 0) represents a scalar.Implicit conversions to and from
std::vector<int64_t>are provided for backward compatibility with existing call sites that usestd::vector<int64_t>for shape parameters.Public Functions
-
inline Shape() noexcept#
Constructs an empty shape (scalar).
-
inline Shape(std::initializer_list<int64_t> il)#
Constructs from a brace-enclosed initializer list, e.g.
Shape{2, 3}. Throwsstd::invalid_argumentwhen the list exceedskMaxRank.
-
inline Shape(const std::vector<int64_t> &v)#
Constructs from a
std::vector<int64_t>(copies all dimensions). Throwsstd::invalid_argumentwhen the vector size exceedskMaxRank.
-
inline Shape(std::vector<int64_t> &&v)#
Constructs from a moved
std::vector<int64_t>(copies all dimensions). Throwsstd::invalid_argumentwhen the vector size exceedskMaxRank.
-
inline Shape &operator=(std::initializer_list<int64_t> il)#
Assigns from a brace-enclosed initializer list. Throws
std::invalid_argumentwhen the list exceedskMaxRank.
-
inline Shape &operator=(const std::vector<int64_t> &v)#
Assigns from a
std::vector<int64_t>. Throwsstd::invalid_argumentwhen the vector size exceedskMaxRank.
-
inline Shape &operator=(std::vector<int64_t> &&v)#
Assigns from a moved
std::vector<int64_t>. Throwsstd::invalid_argumentwhen the vector size exceedskMaxRank.
-
inline operator std::vector<int64_t>() const#
Implicitly converts to
std::vector<int64_t>for backward compatibility.
-
inline size_t size() const noexcept#
Returns the number of valid dimensions.
-
inline bool empty() const noexcept#
Returns
truewhen there are no dimensions (scalar shape).
-
inline int64_t product() const noexcept#
Computes and returns the product of all dimensions; 1 for an empty (scalar) shape.
-
inline int64_t product(size_t begin, size_t end, const std::string &where) const#
Computes the product of dimensions in [begin, end).
Validates the requested range and checks for negative dimensions and INT64 overflow while multiplying.
Parameters: begin: Start index of the dimension range (inclusive). end: End index of the dimension range (exclusive). where: Caller-provided context describing the multiplication site. Returns: The product of the selected dimensions, or 1 for an empty range.
-
inline int64_t *begin() noexcept#
-
inline const int64_t *begin() const noexcept#
-
inline int64_t *end() noexcept#
-
inline const int64_t *end() const noexcept#
-
inline const int64_t *data() const noexcept#
Returns a pointer to the underlying dimension array.
-
inline int64_t &operator[](size_t i) noexcept#
Element access without bounds checking (matches
std::vectorsemantics). Behaviour is undefined wheni >= size().
-
inline const int64_t &operator[](size_t i) const noexcept#
Element access without bounds checking (matches
std::vectorsemantics). Behaviour is undefined wheni >= size().
-
inline void push_back(int64_t v)#
Appends a dimension. Throws
std::invalid_argumentwhen already atkMaxRank.
-
inline void reserve(size_t) noexcept#
No-op: storage is always inline; provided for interface parity with
std::vector.
-
inline void assign(size_t count, int64_t value)#
Replaces the contents with
countcopies ofvalue. Throwsstd::invalid_argumentwhencountexceedskMaxRank.
-
template<typename InputIt, typename = std::enable_if_t<!std::is_integral<InputIt>::value>>
inline void assign(InputIt first, InputIt last)# Replaces the contents with the elements in the range
[first, last). Throwsstd::invalid_argumentwhen the range size exceedskMaxRank.
-
inline int64_t &back()#
Returns a reference to the last dimension. Throws
std::invalid_argumentwhen the shape is empty.
-
inline const int64_t &back() const#
-
inline int64_t *insert(int64_t *pos, int64_t value)#
Inserts
valuebefore the element pointed to bypos. Throwsstd::invalid_argumentwhen already atkMaxRank. Returns an iterator to the inserted element.
Public Static Attributes
-
static constexpr size_t kMaxRank = 16#
Maximum supported tensor rank.
-
inline Shape() noexcept#
-
struct Tensor#
- #include <simple_tensor.h>
Tensor — minimal runtime tensor used by backend test cases.
This struct is intentionally distinct from
TensorProto: it carries no protobuf wire dependency, owns its bytes in row-major little-endian layout, and is meant to be consumed directly by a runtime exercising a single backend test node case.Public Functions
-
Tensor() = default#
-
~Tensor() = default#
-
Tensor(const Tensor &other)#
Deep-copies
other. Whenotheris allocator-backed (has_allocation()), a fresh buffer is acquired from the same allocator and the bytes are duplicated, so the copy never aliasesother’s allocation — the two tensors can be freed independently without a double free. Borrowed (non-owning) views are copied by reference, as before.
-
Tensor(Tensor &&other) noexcept#
Transfers ownership of any allocator-backed allocation from
otherto*thisand resetsotherto a non-owning empty state, soothercan be safely destroyed or overwritten afterwards (e.g. left behind in a map afterstd::move(it->second)) without triggering a double free.
-
inline const uint8_t *bytes() const noexcept#
Returns a pointer to the raw element bytes. Works for both owned (
data) and borrowed (non-owning view) tensors.
-
inline uint8_t *mutable_bytes() noexcept#
Returns a mutable pointer to the raw element bytes. Works for owned tensors and allocator-backed tensors. For borrowed tensors the underlying storage may be read-only; callers must not write through the returned pointer when the tensor was created via :cpp:func:
Borrowwith an immutable backing buffer.
-
inline size_t size_bytes() const noexcept#
Returns the total number of raw element bytes. Works for both owned and borrowed tensors.
-
inline void SetAllocation(RawBufferAllocator *allocator_owner, RawBuffer *allocation)#
Marks the tensor storage as allocator-backed. Callers must release/clear any existing allocation first.
-
inline bool has_allocation() const noexcept#
-
inline bool is_borrowed() const noexcept#
Returns whether the tensor is a non-owning (borrowed) view over external memory (created via :cpp:func:
Borrow/ :cpp:func:BorrowStrings, e.g. a zero-copy view into aTensorProto’sraw_data). Borrowed tensors do not own their bytes: the backing storage must outlive the tensor.
-
inline const std::shared_ptr<void> &borrowed_owner() const noexcept#
Returns the token retaining borrowed byte storage, or an empty token when the caller is responsible for its lifetime.
-
Tensor BorrowView() const#
Creates an immutable-storage view whose metadata is independent while its payload aliases this tensor. This tensor must outlive the returned view.
-
Tensor ToOwned() const#
Returns an owned deep copy of this tensor that references no external memory: the bytes (or, for
STRINGtensors, the strings) are copied into inline storage the returned tensor owns. Use this to detach a borrowed view (see :cpp:func:is_borrowed) from its backing buffer — for example a graph output that borrows into aTensorProto’sraw_data— so it stays valid once that buffer is released. Allocator-backed and already-owned tensors are copied inline as well.
-
inline RawBufferAllocator *allocation_owner() const#
-
inline AllocationHandle ReleaseAllocation() noexcept#
Transfers the allocator-backed storage out of this tensor in O(1).
-
inline void ResetAllocation() noexcept#
Returns allocator-backed storage immediately and leaves the tensor empty.
-
int64_t element_count() const#
Returns the product of all shape dimensions; 1 for an empty shape.
-
size_t element_size() const#
Returns the size in bytes of one element of
data_type. Throwsstd::invalid_argumentfor unsupported types.
-
template<typename T>
const T *As() const# Typed views over the underlying
databuffer. They throw if the requested type does not matchdata_type.The templated
As<T>()accessor is the generic version. The non-templateAsFloat/AsDouble/AsInt32/AsInt64are thin wrappers kept for source compatibility.
-
const float *AsFloat() const#
-
float *AsFloat()#
-
const double *AsDouble() const#
-
double *AsDouble()#
-
const int32_t *AsInt32() const#
-
int32_t *AsInt32()#
-
const int64_t *AsInt64() const#
-
int64_t *AsInt64()#
-
const int8_t *AsInt8() const#
-
int8_t *AsInt8()#
-
const uint8_t *AsUint8() const#
-
uint8_t *AsUint8()#
-
const int16_t *AsInt16() const#
-
int16_t *AsInt16()#
-
const uint16_t *AsUint16() const#
-
uint16_t *AsUint16()#
-
const uint32_t *AsUint32() const#
-
uint32_t *AsUint32()#
-
const uint64_t *AsUint64() const#
-
uint64_t *AsUint64()#
-
const uint8_t *AsBool() const#
Typed view over
dataforBOOLelement type, stored one byte per element. The byte value is 0 for false and non-zero (canonically 1) for true.
-
uint8_t *AsBool()#
-
const std::vector<std::string> &AsStrings() const#
Typed view over the underlying
string_databuffer. Throwsstd::invalid_argumentifdata_typeis notDataType::STRING. Borrowed string tensors return a const reference to the external backing vector; requesting a non-const view of borrowed string storage throwsstd::invalid_argument.
Public Members
-
int32_t data_type = 0#
Element data type stored as a
DataTypeinteger value.
-
RawBuffer data#
Raw element bytes in row-major little-endian layout (owned storage).
Empty when the tensor uses a borrowed (non-owning) view — use :cpp:func:
bytesand :cpp:func:size_bytesto access element bytes regardless of storage mode. Also empty whendata_typeisDataType::STRING; in that case the element values are stored instring_datainstead.
Public Static Functions
-
static inline Tensor FromRawBytes(std::string name, int32_t data_type, Shape shape, RawByteBuffer bytes)#
Creates a tensor by adopting canonical raw-byte storage without copying.
-
static inline Tensor MakeString(std::string n, Shape s, std::vector<std::string> sd)#
Constructs a
STRINGtensor whose elements live instring_data. Distinct from the bytes-based constructor so brace-enclosed{ ... }initializer lists at call sites are unambiguous.
Creates a non-owning (borrowed)
Tensorthat references an external byte buffer without copying.The pointed-to buffer at
ptr[0 .. sz-1]MUST outlive thisTensor. Both the const and non-constAs<T>()overloads (andAsBool()) are available on borrowed tensors; the non-const overloads return aT *viaconst_cast. Callers must not write through that pointer if the underlying storage is immutable — doing so is undefined behaviour.
-
static Tensor BorrowStrings(std::string name, Shape shape, const std::vector<std::string> &strings)#
Creates a non-owning (borrowed)
STRINGtensor that references an external string vector without copying.The referenced string vector MUST outlive this
Tensor.
-
template<typename T>
static Tensor From(const std::string &name, const Shape &shape, const std::vector<T> &values, RawBufferAllocator *allocator = nullptr)# Typed factories that construct a tensor of the given shape and copy the provided values into
data. They throwstd::invalid_argumentif any dimension inshapeis negative or ifvalues.size()does not matchprod(shape).The templated
From<T>factory is the generic version. The non-templateFromFloat/FromDouble/FromInt32/FromInt64are thin wrappers kept for source compatibility.When
allocatoris non-null the element bytes are acquired from it (via :cpp:func:MakeOutputTensor) and the returned tensor is allocator-backed; when null the tensor uses inline :cpp:class:RawBufferstorage. Kernels producing a result should pass the runtime context allocator so no output buffer is allocated outside it.
-
static Tensor FromFloat(const std::string &name, const Shape &shape, const std::vector<float> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromDouble(const std::string &name, const Shape &shape, const std::vector<double> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromInt32(const std::string &name, const Shape &shape, const std::vector<int32_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromInt64(const std::string &name, const Shape &shape, const std::vector<int64_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromInt8(const std::string &name, const Shape &shape, const std::vector<int8_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromUint8(const std::string &name, const Shape &shape, const std::vector<uint8_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromInt16(const std::string &name, const Shape &shape, const std::vector<int16_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromUint16(const std::string &name, const Shape &shape, const std::vector<uint16_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromUint32(const std::string &name, const Shape &shape, const std::vector<uint32_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromUint64(const std::string &name, const Shape &shape, const std::vector<uint64_t> &values, RawBufferAllocator *allocator = nullptr)#
-
static Tensor FromBool(const std::string &name, const Shape &shape, const std::vector<uint8_t> &values, RawBufferAllocator *allocator = nullptr)#
Constructs a
BOOLtensor; element values are stored as one byte each (0 == false, non-zero == true). Provided as auint8_tvector so the usualstd::vector<bool>packing pitfalls are avoided.
-
static Tensor FromStrings(const std::string &name, const Shape &shape, const std::vector<std::string> &values)#
Constructs a
STRINGtensor whose elements are the provided UTF-8 strings (stored instring_data). Throwsstd::invalid_argumentif any dimension inshapeis negative or ifvalues.size()does not matchprod(shape).
Private Members
-
AllocationHandle allocation_#
Move-only ownership of allocator-backed bytes.
-
const uint8_t *borrow_ptr_ = nullptr#
Non-null only for borrowed (non-owning) tensors created via :cpp:func:
Borrow. When set, element bytes are read fromborrow_ptr_[0 .. borrow_size_-1]rather than fromdata.
-
size_t borrow_size_ = 0#
-
Tensor() = default#
-
class Tensors : public std::vector<Tensor>#
- #include <simple_tensor.h>
Tensors— the runtime value produced by kernels that emit more than one tensor (for exampleSplit,Loopor the training optimizers).It is an ordered, owning list of :cpp:struct:
Tensorvalues. Derives fromstd::vector<Tensor>and inherits its constructors, behaving exactly like the underlying vector while giving kernel signatures a named type to express “a list of created tensors” instead of spelling outstd::vector<Tensor>at every call site.
-
using DataType = TensorProto::DataType#
-
namespace runtime
-
namespace core