SetData
Description
Sets the tensor data.
Prototype
void SetData(TensorData &&data)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
data |
Input |
Data to be set. For details about the definition of the TensorData type, see TensorData. |
Returns
None
Restrictions
None
Example
Tensor t{{{8, 3, 224, 224}, {16, 3, 224, 224}}, // shape
{ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, // format
kOnHost, // placement
ge::DT_FLOAT16, //dt
nullptr};
void *a = &t;
TensorData td(a, nullptr);
t.SetData(std::move(td));
Parent topic: Tensor