Skip to content
Snippets Groups Projects
Commit 9f7c89aa authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Merge branch 'EmptyTensorPrint' into 'main'

Empty tensor print

See merge request !71
parents f2127e1f 2db64c84
No related branches found
No related tags found
1 merge request!71Empty tensor print
Pipeline #37283 passed
......@@ -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 += "}";
......
......@@ -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"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment