| 243 | } |
| 244 | |
| 245 | void array::ArrayDesc::init() { |
| 246 | strides.resize(shape.size()); |
| 247 | size = 1; |
| 248 | for (int i = shape.size() - 1; i >= 0; --i) { |
| 249 | strides[i] = size; |
| 250 | size *= shape[i]; |
| 251 | } |
| 252 | for (const auto& in : inputs) { |
| 253 | is_tracer |= in.is_tracer(); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | array::ArrayDesc::ArrayDesc(Shape shape, Dtype dtype) |
| 258 | : shape(std::move(shape)), dtype(dtype), status(Status::available) { |