Struct Tensor

Struct Documentation

struct switchml::Tensor

A struct to group up variables describing a tensor to be processed.

Public Functions

inline void OffsetPtrs(Numel numel)

A convenience function that offsets the tensor pointers by number of elements.

It casts the ptrs to the data_type then increments the pointers by numel argument. The member numel is untouched.

Parameters

numel[in] Number of elements to offset.

Public Members

void *in_ptr

Pointer to the input memory of the tensor. Any data changes are always written to the output. The input data is to be read from only !

void *out_ptr

Pointer to the output memory of the tensor

Numel numel

Number of elements in the tensor. (Not the size)

DataType data_type

The numerical data type of the elements in the tensor