MallocOutputTensor
Header File/Library File
- Header file: #include <exe_graph/runtime/eager_op_execution_context.h>
- Library file: liblowering.so
Function Usage
Allocates device memory for an output tensor and initializes the basic information of the output tensor.
The memory of the output tensor is managed by the context creator. The API caller does not need to proactively release the memory.
Prototype
1 | Tensor *MallocOutputTensor(size_t index, const StorageShape &shape, const StorageFormat &format, ge::DataType dtype, size_t tensor_size) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
index |
Input |
Output index. |
shape |
Input |
Shape of the output tensor. |
format |
Input |
Format of the output tensor. |
dtype |
Input |
Data type of the output tensor. |
tensor_size |
Input |
Size of the output tensor, in bytes. |
Returns
Tensor pointer. If an exception occurs, a null pointer is returned.
Restrictions
None
Parent topic: EagerOpExecutionContext