Visible to Intel only — GUID: GUID-7C4E98E0-FDA4-4593-A234-09680A10974B
Visible to Intel only — GUID: GUID-7C4E98E0-FDA4-4593-A234-09680A10974B
class dnnl::graph::tensor
Overview
A tensor object. More…
#include <dnnl_graph.hpp>
class tensor: public tensor_handle
{
public:
// construction
tensor();
tensor(const logical_tensor& lt, const engine& aengine, void* handle);
tensor(const logical_tensor& lt, const engine& aengine);
// methods
void* get_data_handle() const;
void set_data_handle(void* handle);
engine get_engine() const;
};
Detailed Documentation
A tensor object.
Construction
tensor()
Default constructor. Constructs an empty object.
tensor(const logical_tensor& lt, const engine& aengine, void* handle)
Constructs a tensor object according to a given logical tensor, an engine, and a memory handle.
Parameters:
lt |
The given logical tensor |
aengine |
Engine to store the data on. |
handle |
Handle of memory buffer to use as an underlying storage.
|
tensor(const logical_tensor& lt, const engine& aengine)
Constructs a tensor object.
The underlying buffer for the memory will be allocated by the library.
Parameters:
lt |
The given logical tensor |
aengine |
Engine to store the data on. |
Methods
void* get_data_handle() const
Returns the underlying memory buffer.
On the CPU engine, or when using USM, this is a pointer to the allocated memory.
void set_data_handle(void* handle)
Sets the underlying memory handle.
Parameters:
handle |
Memory handle. |
engine get_engine() const
Returns the associated engine.
Returns:
An engine object