Get shape of current Tensor. @return an array representing shape of current tensor
()
| 171 | * @return an array representing shape of current tensor |
| 172 | */ |
| 173 | public long[] shape() { |
| 174 | List<Long> data = new ArrayList<Long>(); |
| 175 | Base.checkCall(Base._LIB.tvmFFIDLTensorGetShape(this.dltensorHandle, data)); |
| 176 | long[] shapeArr = new long[data.size()]; |
| 177 | for (int i = 0; i < shapeArr.length; ++i) { |
| 178 | shapeArr[i] = data.get(i); |
| 179 | } |
| 180 | return shapeArr; |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Get total size of current Tensor. |