| 40 | } |
| 41 | |
| 42 | std::vector<array> array::make_arrays( |
| 43 | std::vector<Shape> shapes, |
| 44 | const std::vector<Dtype>& dtypes, |
| 45 | const std::shared_ptr<Primitive>& primitive, |
| 46 | const std::vector<array>& inputs) { |
| 47 | std::vector<array> outputs; |
| 48 | for (size_t i = 0; i < shapes.size(); ++i) { |
| 49 | outputs.emplace_back(std::move(shapes[i]), dtypes[i], primitive, inputs); |
| 50 | } |
| 51 | // For each node in |outputs|, its siblings are the other nodes. |
| 52 | for (size_t i = 0; i < outputs.size(); ++i) { |
| 53 | auto siblings = outputs; |
| 54 | siblings.erase(siblings.begin() + i); |
| 55 | outputs[i].set_siblings(std::move(siblings), i); |
| 56 | } |
| 57 | return outputs; |
| 58 | } |
| 59 | |
| 60 | array array::unsafe_weak_copy(const array& other) { |
| 61 | auto cpy = array(other.shape(), other.dtype(), nullptr, {}); |
nothing calls this directly
no test coverage detected