SetOffset

Function Usage

Sets the offset of a tensor.

Prototype

1
void SetOffset(const int64_t offset)

Parameters

Offset of a tensor.

Returns

None

Constraints

None

Examples

1
2
3
4
5
StorageShape sh({1, 2, 3}, {1, 2, 3});
Stride str({6, 3, 1});
TensorV2 t = {sh, {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, kOnHost, ge::DT_FLOAT, nullptr,nullptr, str, 0};
t.SetOffset(10);
auto offset = t.GetOffset(); // 10