diff --git a/include/aidge/data/Tensor.hpp b/include/aidge/data/Tensor.hpp index 681e8ca618795a85a1e3a55a413dbfd74d5b0ea2..8129a900718169861dc2df4213cd3533d1dfe570 100644 --- a/include/aidge/data/Tensor.hpp +++ b/include/aidge/data/Tensor.hpp @@ -391,7 +391,7 @@ class Tensor : public Data, std::string toString() const { - AIDGE_ASSERT(mImpl && mImpl->hostPtr() != nullptr, "tensor should have a valid host pointer"); + AIDGE_ASSERT(mImpl && (dims().empty() || (dims() == std::vector<DimSize_t>({0})) || (mImpl->hostPtr() != nullptr)), "tensor should have a valid host pointer"); // TODO: move lambda elsewhere? auto ptrToString = [](DataType dt, void* ptr, size_t idx) { @@ -471,7 +471,7 @@ class Tensor : public Data, } else { res += "{"; for (DimSize_t j = 0; j < dims()[0]; ++j) { - res += " " + ptrToString(mDataType, mImpl->hostPtr(), j) + ((j < dims()[0]-1) ? "," : ""); + res += " " + ptrToString(mDataType, mImpl->hostPtr(), j) + ((j < dims()[0]-1) ? "," : " "); } } res += "}"; diff --git a/python_binding/graph/pybind_GraphView.cpp b/python_binding/graph/pybind_GraphView.cpp index 8e0da01c89767844040fcbc7b48e727800436daa..eb26538a5db1eb40fdcb8a2e409067483d4a7d68 100644 --- a/python_binding/graph/pybind_GraphView.cpp +++ b/python_binding/graph/pybind_GraphView.cpp @@ -71,15 +71,19 @@ void init_GraphView(py::module& m) { const IOIndex_t, IOIndex_t)) & GraphView::addChild, - py::arg("toOtherNode"), py::arg("fromOutNode") = nullptr, - py::arg("fromTensor") = 0U, py::arg("toTensor") = gk_IODefaultIndex, + py::arg("to_other_node"), py::arg("from_out_node") = nullptr, + py::arg("from_tensor") = 0U, py::arg("to_tensor") = gk_IODefaultIndex, R"mydelimiter( Include a Node to the current GraphView object. - :param other_node: Node to add - :type oth_Node: Node - :param includeLearnableParameter: include non-data inputs, like weights and biases. Default True. - :type includeLearnableParameter + :param to_other_node: Node to add + :type to_other_node: Node + :param from_out_node: Node inside the GraphView the new Node will be linked to (it will become a parent of the new Node). If the GraphView only has one output Node, then default to this Node. + :type from_out_node: Node + :param from_tensor: Ouput Tensor ID of the already included Node. Default to 0. + :type from_tensor: int + :param to_tensor: Input Tensor ID of the new Node. Default to gk_IODefaultIndex, meaning first available data input for the Node. + :type to_tensor: int )mydelimiter") .def_static("replace", &GraphView::replace, py::arg("old_nodes"), py::arg("new_nodes"),