判断输入tensor是否为一个连续tensor。
bool IsContiguous(const aclTensor *tensor)
参数 |
输入/输出 |
说明 |
---|---|---|
tensor |
输入 |
目标tensor。 |
若为连续tensor返回true,否则返回false。
1 2 3 4 5 6 | // 判断当tensor非连续时,返回。 void Func(aclTensor *tensor) { if (!IsContiguous(tensor)) { return; } } |