SetData
Function Usage
Sets the tensor data.
Prototype
1 | 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
Constraints
None
Examples
1 2 3 4 5 6 7 8 | 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