diff --git a/aidge/aidge_backend_cpu b/aidge/aidge_backend_cpu index a7666da2e654db9e3b9be786c61f905069c7a325..d111493246ae4835681c47510cb08031950b3790 160000 --- a/aidge/aidge_backend_cpu +++ b/aidge/aidge_backend_cpu @@ -1 +1 @@ -Subproject commit a7666da2e654db9e3b9be786c61f905069c7a325 +Subproject commit d111493246ae4835681c47510cb08031950b3790 diff --git a/aidge/aidge_backend_cuda b/aidge/aidge_backend_cuda index fa57d1d18fb54fcfc5753ddf1b9bfbc862bf74f2..c18f99dd639635c4b2668664e087e50871bb17e3 160000 --- a/aidge/aidge_backend_cuda +++ b/aidge/aidge_backend_cuda @@ -1 +1 @@ -Subproject commit fa57d1d18fb54fcfc5753ddf1b9bfbc862bf74f2 +Subproject commit c18f99dd639635c4b2668664e087e50871bb17e3 diff --git a/aidge/aidge_backend_opencv b/aidge/aidge_backend_opencv index fd7466dfffdb85cd8f8f3c7143059e7895c4360c..ac47767e9016014e95387480a3ebe731b1f4b1e8 160000 --- a/aidge/aidge_backend_opencv +++ b/aidge/aidge_backend_opencv @@ -1 +1 @@ -Subproject commit fd7466dfffdb85cd8f8f3c7143059e7895c4360c +Subproject commit ac47767e9016014e95387480a3ebe731b1f4b1e8 diff --git a/aidge/aidge_core b/aidge/aidge_core index 928cb2389b931be9c8d76daa3f3feef0b6537eb0..28fe9a4344bf556949974ea2ad84248f30b9caf7 160000 --- a/aidge/aidge_core +++ b/aidge/aidge_core @@ -1 +1 @@ -Subproject commit 928cb2389b931be9c8d76daa3f3feef0b6537eb0 +Subproject commit 28fe9a4344bf556949974ea2ad84248f30b9caf7 diff --git a/aidge/aidge_export_cpp b/aidge/aidge_export_cpp index 64d65c9b68f86816b13b252b0d08c537776b0cf7..c30ca76080b0aeb43183525b08fe585c1f38bc40 160000 --- a/aidge/aidge_export_cpp +++ b/aidge/aidge_export_cpp @@ -1 +1 @@ -Subproject commit 64d65c9b68f86816b13b252b0d08c537776b0cf7 +Subproject commit c30ca76080b0aeb43183525b08fe585c1f38bc40 diff --git a/aidge/aidge_learning b/aidge/aidge_learning index 7473931866b481bd95b3f6a5593ffd5f70fb89d6..671b844081457d387ae17c437da76f1d54965b06 160000 --- a/aidge/aidge_learning +++ b/aidge/aidge_learning @@ -1 +1 @@ -Subproject commit 7473931866b481bd95b3f6a5593ffd5f70fb89d6 +Subproject commit 671b844081457d387ae17c437da76f1d54965b06 diff --git a/aidge/aidge_onnx b/aidge/aidge_onnx index 2f1038678353f5e7744717374ffea0c0b642a21d..f14ce43460b0078379519f4b1a0f3c0f8c0da23f 160000 --- a/aidge/aidge_onnx +++ b/aidge/aidge_onnx @@ -1 +1 @@ -Subproject commit 2f1038678353f5e7744717374ffea0c0b642a21d +Subproject commit f14ce43460b0078379519f4b1a0f3c0f8c0da23f diff --git a/aidge/aidge_quantization b/aidge/aidge_quantization index 5c93e9908b8ef9b69d88b2d65eaaba9a870b50d6..3b7cc2547c0a79f3ab71f48835fe28bec058e7c9 160000 --- a/aidge/aidge_quantization +++ b/aidge/aidge_quantization @@ -1 +1 @@ -Subproject commit 5c93e9908b8ef9b69d88b2d65eaaba9a870b50d6 +Subproject commit 3b7cc2547c0a79f3ab71f48835fe28bec058e7c9 diff --git a/clean_all.sh b/clean_all.sh new file mode 100755 index 0000000000000000000000000000000000000000..69e898600a6fff5e663b517cf88240fb53d5d719 --- /dev/null +++ b/clean_all.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +find . -maxdepth 1 -type f -name "clean_*" ! -name "clean_all.sh" -exec {} \; diff --git a/clean_builds.sh b/clean_builds.sh index 3142ae6e36c9f04746588ee6378ad525dfedec36..2c4b3ca17e54e82d3c2a3260cca37e24dae94370 100755 --- a/clean_builds.sh +++ b/clean_builds.sh @@ -13,7 +13,7 @@ BUILDPATHS=() while IFS= read -r -d '' dir; do # Add each directory to the BUILDPATHS list BUILDPATHS+=("$dir") -done < <(find . -type d -name "build_bundle_cpp" -print0) +done < <(find . -type d -name "build*" -print0) ## Print and remove the list of build paths for path in "${BUILDPATHS[@]}"; do diff --git a/clean_graphs.sh b/clean_graphs.sh new file mode 100755 index 0000000000000000000000000000000000000000..503917a19142832738ccf7f3867194de7fae5aa6 --- /dev/null +++ b/clean_graphs.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Get the directory in which the script is located +script_directory="$(pwd)" + +# Use find to locate files with the .mmd extension and print the list +files_to_remove=$(find "$script_directory" -type f -name "*.mmd") +echo "$files_to_remove" + +find "$script_directory" -type f -name "*.mmd" -exec rm -f {} + + +echo "Files with .mmd extension removed in $(pwd)" diff --git a/clean_pip.sh b/clean_pip.sh new file mode 100755 index 0000000000000000000000000000000000000000..b523ad99a47626cd4e05e184a6026cb89f7f207b --- /dev/null +++ b/clean_pip.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +pip list | grep 'aidge' | cut -d ' ' -f 1 | xargs pip uninstall -y diff --git a/examples/tutorials/101_first_step/load_and_run.ipynb b/examples/tutorials/101_first_step/load_and_run.ipynb index 7d560aa81c5a87184b1230314c200840fc13aa05..91c598d15880440de67b015c6dfddf5d3d30fa32 100644 --- a/examples/tutorials/101_first_step/load_and_run.ipynb +++ b/examples/tutorials/101_first_step/load_and_run.ipynb @@ -51,7 +51,7 @@ " f.write(response.content)\n", " print(\"File downloaded successfully.\")\n", " else:\n", - " print(\"Failed to download file. Status code:\", response.status_code) \n", + " print(\"Failed to download file. Status code:\", response.status_code)\n", "\n", "# Download onnx model file\n", "download_material(\"MLP_MNIST.onnx\")\n", @@ -205,7 +205,7 @@ "outputs": [], "source": [ "model.save(\"myModel\")\n", - "visualize_mmd(\"myModel.mmd\")\n" + "visualize_mmd(\"myModel.mmd\")" ] }, { @@ -266,7 +266,7 @@ "outputs": [], "source": [ "all_match = graph_regex.match(model)\n", - "print('Number of match : ', len(all_match))\n" + "print('Number of match : ', len(all_match))" ] }, { @@ -291,7 +291,7 @@ " print('\\t', match.get_start_node()[0].type())\n", " print('All the matched nodes for', match.get_query() , ':')\n", " for n in match.get_all():\n", - " print('\\t', n.type())\n" + " print('\\t', n.type())" ] }, { @@ -316,7 +316,7 @@ "source": [ "g = aidge_core.GraphView()\n", "g.add(next(iter(all_match)).get_start_node()[0])\n", - "aidge_core.GraphView.replace(g.get_nodes(), set())\n" + "aidge_core.GraphView.replace(g.get_nodes(), set())" ] }, { @@ -358,7 +358,7 @@ "# Import model again\n", "model = aidge_onnx.load_onnx(\"MLP_MNIST.onnx\")\n", "# Use remove_flatten recipie\n", - "aidge_core.remove_flatten(model)\n" + "aidge_core.remove_flatten(model)" ] }, { @@ -375,7 +375,7 @@ "outputs": [], "source": [ "model.save(\"mySupportedModel\")\n", - "visualize_mmd(\"mySupportedModel.mmd\")\n" + "visualize_mmd(\"mySupportedModel.mmd\")" ] }, { @@ -471,7 +471,7 @@ "outputs": [], "source": [ "# Configure the model\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32, dims=[[1,1,28,28]])\n", + "model.compile(\"cpu\", aidge_core.dtype.float32, dims=[[1,1,28,28]])\n", "# equivalent to set_datatype(), set_backend() and forward_dims()" ] }, @@ -584,7 +584,7 @@ "# Freeze the model by setting constant to parameters producers\n", "for node in model.get_nodes():\n", " if node.type() == \"Producer\":\n", - " node.get_operator().set_attr(\"Constant\", True)\n", + " node.get_operator().attr.constant = True\n", "\n", "# Create Producer Node for the Graph\n", "input_node = aidge_core.Producer([1, 1, 28, 28], \"input\")\n", @@ -592,7 +592,7 @@ "model.add(input_node)\n", "\n", "# Configuration for the model + forward dimensions\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32)\n", + "model.compile(\"cpu\", aidge_core.dtype.float32)\n", "# Export the model in C++ standalone\n", "aidge_export_cpp.export(\"myexport\", model, scheduler)\n" ] @@ -688,7 +688,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.10.14" }, "orig_nbformat": 4 }, diff --git a/examples/tutorials/Backend_cuda_tutorial/Backend_cuda.ipynb b/examples/tutorials/Backend_cuda_tutorial/Backend_cuda.ipynb index 20782cc5f3ada30495a13542d33c4f624c02e0fc..a0b3ba9032f964cdc958ebc9105ffb25baab3b07 100644 --- a/examples/tutorials/Backend_cuda_tutorial/Backend_cuda.ipynb +++ b/examples/tutorials/Backend_cuda_tutorial/Backend_cuda.ipynb @@ -91,7 +91,7 @@ "aidge_core.remove_flatten(model)\n", "\n", "# Configure the model\n", - "model.set_datatype(aidge_core.DataType.Float32)\n", + "model.set_datatype(aidge_core.dtype.float32)\n", "model.set_backend(\"cuda\")" ] }, @@ -112,7 +112,7 @@ "input = np.random.randn(1, 1, 28, 28).astype(np.float32)\n", "input_tensor = aidge_core.Tensor(input)\n", "input_node = aidge_core.Producer(input_tensor, \"input\")\n", - "input_node.get_operator().set_datatype(aidge_core.DataType.Float32)\n", + "input_node.get_operator().set_datatype(aidge_core.dtype.float32)\n", "input_node.get_operator().set_backend(\"cuda\")\n", "\n", "# Link node to model\n", @@ -157,7 +157,7 @@ " outNode.get_operator().get_output(0).set_backend('cpu')\n", " output_aidge = np.array(outNode.get_operator().get_output(0))\n", " print(\"Aidge output: {}\".format(output_aidge))\n", - " # Make sure to set the output back to \"cuda\" otherwise the model will not be usable \n", + " # Make sure to set the output back to \"cuda\" otherwise the model will not be usable\n", " outNode.get_operator().get_output(0).set_backend('cuda')" ] } @@ -178,7 +178,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.1.-1" } }, "nbformat": 4, diff --git a/examples/tutorials/Database_DataProvider_tutorial/Database.ipynb b/examples/tutorials/Database_DataProvider_tutorial/Database.ipynb index 30dc93aed0c8d96e5f5cd66d14c7482b5e9c0753..a3bbe5c86aef9bdae3e02f6daedb49e762513e57 100644 --- a/examples/tutorials/Database_DataProvider_tutorial/Database.ipynb +++ b/examples/tutorials/Database_DataProvider_tutorial/Database.ipynb @@ -144,7 +144,7 @@ "outputs": [], "source": [ "# Configure the model\n", - "model.set_datatype(aidge_core.DataType.Float32)\n", + "model.set_datatype(aidge_core.dtype.float32)\n", "model.set_backend(\"cpu\")\n", "\n", "# Define the scheduler\n", @@ -157,13 +157,13 @@ "metadata": {}, "outputs": [], "source": [ - "val_mnist = aidge_backend_opencv.MNIST(dataPath=\"./MNIST_test\", \n", + "val_mnist = aidge_backend_opencv.MNIST(dataPath=\"./MNIST_test\",\n", " train=False,\n", " load_data_in_memory=False)\n", "\n", - "val_dataprovider = aidge_core.DataProvider(val_mnist, \n", - " batch_size=200, \n", - " shuffle=True, \n", + "val_dataprovider = aidge_core.DataProvider(val_mnist,\n", + " batch_size=200,\n", + " shuffle=True,\n", " drop_last=False)\n" ] }, @@ -177,18 +177,18 @@ "\n", "for i, (data_batch, lbl_batch) in enumerate(val_dataprovider):\n", "\n", - " data_batch.set_datatype(aidge_core.DataType.Float32)\n", - " lbl_batch.set_datatype(aidge_core.DataType.Float32)\n", + " data_batch.set_datatype(aidge_core.dtype.float32)\n", + " lbl_batch.set_datatype(aidge_core.dtype.float32)\n", "\n", " # Run inference !\n", " scheduler.forward(data=[data_batch])\n", - " \n", + "\n", " # Get output and label in a numpy array\n", " output_aidge = np.array(list(model.get_output_nodes())[0].get_operator().get_output(0))\n", " lbl = np.array(lbl_batch)\n", "\n", " # Compute the top-1 accuracy\n", - " val_acc += top1_accuracy(output_aidge, lbl.flatten()) \n", + " val_acc += top1_accuracy(output_aidge, lbl.flatten())\n", "\n", "val_acc = val_acc / len(val_dataprovider)\n", "\n", @@ -213,7 +213,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/examples/tutorials/GraphRegex_tutorial/GraphRegex.ipynb b/examples/tutorials/GraphRegex_tutorial/GraphRegex.ipynb index 65a4d69b9bfe4c46da094d17d5aafec77652b3a8..6f36ef097a146b025c0e83c8bd8afffab36978d9 100644 --- a/examples/tutorials/GraphRegex_tutorial/GraphRegex.ipynb +++ b/examples/tutorials/GraphRegex_tutorial/GraphRegex.ipynb @@ -164,7 +164,7 @@ "metadata": {}, "outputs": [], "source": [ - "import aidge_core \n", + "import aidge_core\n", "\n", "model = aidge_core.sequential([aidge_core.MatMul(name=\"MatMul0\"),\n", " aidge_core.Add(2, name=\"Add0\"),\n", @@ -303,7 +303,7 @@ "import aidge_core\n", "\n", "conv = aidge_core.Conv2D(1, 1, [7, 7], name=\"C\")\n", - "print(conv.get_operator().get_attr(\"KernelDims\") == [7,7])\n", + "print(conv.get_operator().attr.kernel_dims == [7,7])\n", "print(conv.type())\n", "\n", "\n", @@ -335,13 +335,13 @@ "def test_kernel_3(node):\n", " b = False\n", " if (node.type() == \"Conv\") :\n", - " b = node.get_operator().get_attr(\"KernelDims\") == [3,3]\n", + " b = node.get_operator().attr.kernel_dims == [3,3]\n", " return b\n", "\n", "def test_kernel_5(node):\n", " b = False\n", " if (node.type() == \"Conv\") :\n", - " b = node.get_operator().get_attr(\"KernelDims\") == [5,5]\n", + " b = node.get_operator().attr.kernel_dims == [5,5]\n", " return b" ] }, @@ -365,7 +365,7 @@ "graph_regex.set_node_key(\"testk5\", test_kernel_5)\n", "graph_regex.set_node_key(\"Convk3\", \"testk3($)==true\")\n", "graph_regex.set_node_key(\"Convk5\", \"testk5($)==true\")\n", - " \n", + "\n", "#Add the associated queries\n", "graph_regex.add_query(\"Convk3\")\n", "graph_regex.add_query(\"Convk5\")\n", diff --git a/examples/tutorials/Hardmax_operator/operator_adding.ipynb b/examples/tutorials/Hardmax_operator/operator_adding.ipynb index af0cfe01dd1d1aad35c688c9b7c2a69421003d88..cbdad4bb50c06651a479055cc3af7c946b1a5866 100644 --- a/examples/tutorials/Hardmax_operator/operator_adding.ipynb +++ b/examples/tutorials/Hardmax_operator/operator_adding.ipynb @@ -320,7 +320,7 @@ "input_tensor = aidge_core.Tensor(np.random.randn(1, 10).astype(np.float32))\n", "\n", "# Setup model's features: data type, backend and input dimensions\n", - "aidge_model.compile(\"cpu\", aidge_core.DataType.Float32, dims=[[1,10]])\n", + "aidge_model.compile(\"cpu\", aidge_core.dtype.float32, dims=[[1,10]])\n", "\n", "# Set up the scheduler\n", "scheduler = aidge_core.SequentialScheduler(aidge_model)\n", diff --git a/examples/tutorials/Learning/learn.ipynb b/examples/tutorials/Learning/learn.ipynb index 58513607bd7848551cfa78f5db0f29a8537500ca..cd955b9c32a8e37dcd77b1ef9d11254560b3fe17 100644 --- a/examples/tutorials/Learning/learn.ipynb +++ b/examples/tutorials/Learning/learn.ipynb @@ -76,7 +76,7 @@ "source": [ "# Set backend and datatype\n", "model.set_backend(\"cpu\")\n", - "model.set_datatype(aidge_core.DataType.Float32)\n", + "model.set_datatype(aidge_core.dtype.float32)\n", "\n", "# Initialize parameters (weights and biases)\n", "for node in model.get_nodes():\n", @@ -124,7 +124,7 @@ " values = [float(0.0)] * nb_cls\n", " values[cls] = float(1.0)\n", " t = aidge_core.Tensor(values)\n", - " t.set_datatype(aidge_core.DataType.Float32)\n", + " t.set_datatype(aidge_core.dtype.float32)\n", " return t\n", "\n", "class aidge_cifar10(aidge_core.Database):\n", @@ -227,7 +227,7 @@ "\n", "tot_acc = 0\n", "for i, (input, label) in enumerate(aidge_dataprovider):\n", - " input.init_grad()\n", + " # input.init_grad()\n", " scheduler.forward(data=[input])\n", " # Really long line should be a faster way ...\n", " pred = list(model.get_output_nodes())[0].get_operator().get_output(0)\n", @@ -258,7 +258,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/examples/tutorials/Onnx_tutorial/onnx_tuto.ipynb b/examples/tutorials/Onnx_tutorial/onnx_tuto.ipynb index dc755fe83eaf2b3161a22f50fa42cb2d9ef12e9a..d2292354bcf351b3bd9d2ab9cf9ebb7034abafd2 100644 --- a/examples/tutorials/Onnx_tutorial/onnx_tuto.ipynb +++ b/examples/tutorials/Onnx_tutorial/onnx_tuto.ipynb @@ -218,7 +218,7 @@ "metadata": {}, "outputs": [], "source": [ - "graph.compile(\"cpu\", aidge_core.DataType.Float32, dims=[[1,10]])\n", + "graph.compile(\"cpu\", aidge_core.dtype.float32, dims=[[1,10]])\n", "scheduler = aidge_core.SequentialScheduler(graph)\n", "scheduler.forward(data=[in_tensor])\n", "\n", @@ -411,11 +411,11 @@ "data_input.add_child(supported_graph)\n", "supported_graph.add(data_input)\n", "\n", - "data_input.get_operator().set_datatype(aidge_core.DataType.Float32)\n", + "data_input.get_operator().set_datatype(aidge_core.dtype.float32)\n", "\n", "data_input.get_operator().set_backend(\"cpu\")\n", "\n", - "supported_graph.set_datatype(aidge_core.DataType.Float32)\n", + "supported_graph.set_datatype(aidge_core.dtype.float32)\n", "supported_graph.set_backend(\"cpu\")\n", "\n", "# Create SCHEDULER\n", @@ -454,7 +454,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.1.-1" } }, "nbformat": 4, diff --git a/examples/tutorials/PTQ_tutorial/ptq_tuto.ipynb b/examples/tutorials/PTQ_tutorial/ptq_tuto.ipynb index 5f5819f760c33929d0d92727a16df3edac14150a..74bbed3d34e0c35ee95f2f2ee05079ea0f93cbc5 100644 --- a/examples/tutorials/PTQ_tutorial/ptq_tuto.ipynb +++ b/examples/tutorials/PTQ_tutorial/ptq_tuto.ipynb @@ -71,7 +71,7 @@ " f.write(response.content)\n", " print(\"File downloaded successfully.\")\n", " else:\n", - " print(\"Failed to download file. Status code:\", response.status_code) \n", + " print(\"Failed to download file. Status code:\", response.status_code)\n", "\n", "# Download onnx model file\n", "download_material(\"ConvNet.onnx\")\n", @@ -202,7 +202,7 @@ "aidge_model.add(input_node)\n", "\n", "# Set up the backend\n", - "aidge_model.set_datatype(aidge_core.DataType.Float32)\n", + "aidge_model.set_datatype(aidge_core.dtype.float32)\n", "aidge_model.set_backend(\"cpu\")\n", "\n", "# Create the Scheduler\n", @@ -403,7 +403,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/examples/tutorials/Tiling_tutorial/tiling.ipynb b/examples/tutorials/Tiling_tutorial/tiling.ipynb index 610537453c44c8658b1f7b9778f34e52308b3a35..bcd9ba53837f37471c9a3b3b7e1dce718e644719 100644 --- a/examples/tutorials/Tiling_tutorial/tiling.ipynb +++ b/examples/tutorials/Tiling_tutorial/tiling.ipynb @@ -154,7 +154,7 @@ "metadata": {}, "outputs": [], "source": [ - "model.compile(\"cpu\", aidge_core.DataType.Float32, dims=[[4,3,66,66]])" + "model.compile(\"cpu\", aidge_core.dtype.float32, dims=[[4,3,66,66]])" ] }, { @@ -235,7 +235,7 @@ "metadata": {}, "outputs": [], "source": [ - "model.compile(\"cpu\", aidge_core.DataType.Float32)\n", + "model.compile(\"cpu\", aidge_core.dtype.float32)\n", "scheduler.resetScheduling()\n", "scheduler.forward(data=[input_tensor])\n", "res2 = np.array(model.get_node(\"relu0\").get_operator().get_output(0))" @@ -274,7 +274,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.14" + "version": "3.1.-1" } }, "nbformat": 4, diff --git a/examples/tutorials/export/aidge_to_STM32/export_LeNet/export_lenet_fp32.ipynb b/examples/tutorials/export/aidge_to_STM32/export_LeNet/export_lenet_fp32.ipynb index 55512915ca16f18c375a794cbbe69c6327f528bb..bb71ecdfbf70284c08ba359dc55620d6aadfa87e 100644 --- a/examples/tutorials/export/aidge_to_STM32/export_LeNet/export_lenet_fp32.ipynb +++ b/examples/tutorials/export/aidge_to_STM32/export_LeNet/export_lenet_fp32.ipynb @@ -91,7 +91,7 @@ "# Freeze the model by setting constant to parameters producers\n", "for node in model.get_nodes():\n", " if node.type() == \"Producer\":\n", - " node.get_operator().set_attr(\"Constant\", True)\n", + " node.get_operator().attr.constant = True\n", "\n", "# Create Producer Node for the Graph\n", "input_node = aidge_core.Producer([1, 1, 28, 28], \"input\")\n", @@ -99,7 +99,7 @@ "model.add(input_node)\n", "\n", "# Configuration for the model + forward dimensions\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32)" + "model.compile(\"cpu\", aidge_core.dtype.float32)" ] }, { @@ -273,7 +273,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/examples/tutorials/export/aidge_to_cpp/add_custom_operator/add_custom_operator.ipynb b/examples/tutorials/export/aidge_to_cpp/add_custom_operator/add_custom_operator.ipynb index 4cd384189a3c7bce7fa3d316973fe0f3db890ee4..9924fef433c29d7aa371697346df4382763fa750 100644 --- a/examples/tutorials/export/aidge_to_cpp/add_custom_operator/add_custom_operator.ipynb +++ b/examples/tutorials/export/aidge_to_cpp/add_custom_operator/add_custom_operator.ipynb @@ -81,7 +81,7 @@ "# Freeze the model by setting constant to parameters producers\n", "for node in model.get_nodes():\n", " if node.type() == \"Producer\":\n", - " node.get_operator().set_attr(\"Constant\", True)\n", + " node.get_operator().attr.constant = True\n", "\n", "# Create Producer Node for the Graph\n", "input_node = aidge_core.Producer([1, 1, 28, 28], \"input\")\n", @@ -124,11 +124,11 @@ "\n", " # We instanciate Swish as a generic operator\n", " node_swish = aidge_core.GenericOperator(\"Swish\", nb_data=1, nb_param=0, nb_out=1, name=f\"swish_{switch_id}\")\n", - " node_swish.get_operator().add_attr(\"betas\", [1.0]*node_ReLU.get_operator().get_input(0).dims()[1])\n", + " node_swish.get_operator().attr.betas = [1.0]*node_ReLU.get_operator().get_input(0).dims()[1]\n", "\n", " print('Replacing ', node_ReLU.type(), ' : ', node_ReLU.name(), ' with ' , node_swish.name())\n", " aidge_core.GraphView.replace(set([node_ReLU]), set([node_swish]))\n", - " \n", + "\n", " switch_id+=1" ] }, @@ -197,7 +197,7 @@ "outputs": [], "source": [ "scheduler = aidge_core.SequentialScheduler(model)\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32)\n", + "model.compile(\"cpu\", aidge_core.dtype.float32)\n", "scheduler.generate_scheduling()\n", "s = scheduler.get_static_scheduling()" ] @@ -233,19 +233,19 @@ " def __init__(self, node):\n", " super().__init__(node)\n", "\n", - " self.betas = self.operator.get_attr(\"betas\")\n", + " self.betas = self.operator.attr.betas\n", "\n", " if len(self.outputs_dims[0]) == 2:\n", " # Case : Swish is after a Fully Connected\n", " # outputdims = [batch, nb_outputs]\n", " # transform to [nb_outputs, 1, 1]\n", " self.outputs_dims[0] = [self.outputs_dims[0][1], 1, 1]\n", - " \n", + "\n", " # To complete - Case : Swish is after a convolution\n", " # if len(self.outputs_dims[0]) == 4:\n", " # Case : Swish is after a convolution\n", " # outputdims = [batch, nb_outputs, Height, Width]\n", - " \n", + "\n", "\n", " def export(self, export_folder:str, list_configs:list):\n", "\n", @@ -354,7 +354,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/examples/tutorials/export/aidge_to_cpp/add_custom_operator/solution/add_custom_operator_solution.ipynb b/examples/tutorials/export/aidge_to_cpp/add_custom_operator/solution/add_custom_operator_solution.ipynb index 7c0639491c72483c4ead3931c27e10d584b381e8..e4aae6d5ae0c84614e5bfde9d8022fa62ed68f64 100644 --- a/examples/tutorials/export/aidge_to_cpp/add_custom_operator/solution/add_custom_operator_solution.ipynb +++ b/examples/tutorials/export/aidge_to_cpp/add_custom_operator/solution/add_custom_operator_solution.ipynb @@ -197,7 +197,7 @@ "outputs": [], "source": [ "scheduler = aidge_core.SequentialScheduler(model)\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32)\n", + "model.compile(\"cpu\", aidge_core.dtype.float32)\n", "scheduler.generate_scheduling()\n", "s = scheduler.get_static_scheduling()" ] diff --git a/examples/tutorials/export/aidge_to_cpp/export_LeNet/export_lenet_fp32.ipynb b/examples/tutorials/export/aidge_to_cpp/export_LeNet/export_lenet_fp32.ipynb index 24fe205a9d781bc6f6adfbe8c9a13a996ca674e7..349dc773a9d19fceb857bd72627ac329ebb0697e 100644 --- a/examples/tutorials/export/aidge_to_cpp/export_LeNet/export_lenet_fp32.ipynb +++ b/examples/tutorials/export/aidge_to_cpp/export_LeNet/export_lenet_fp32.ipynb @@ -98,7 +98,7 @@ "model.add(input_node)\n", "\n", "# Configuration for the model + forward dimensions\n", - "model.compile(\"cpu\", aidge_core.DataType.Float32)" + "model.compile(\"cpu\", aidge_core.dtype.float32)" ] }, { diff --git a/setup.sh b/setup.sh index 5f197e61a749383913f6ba883b70ab3597fa0718..995dea938fdaabe2f8f5d9d7a652f494b4642194 100755 --- a/setup.sh +++ b/setup.sh @@ -172,7 +172,7 @@ for module_name in "${ordered_list[@]}"; do cd aidge/${module_name}/build_bundle_cpp/ echo "cmake -DCMAKE_INSTALL_PREFIX:PATH=${AIDGE_INSTALL} -DCMAKE_BUILD_TYPE=${OPT_BUILD_MODE} -DPYBIND=${OPT_WITH_PYBIND} -DTEST=${OPT_WITH_TESTS} -DENABLE_ASAN=${OPT_ASAN} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ${@} .." # PS1="\u@\h $(cmake -DCMAKE_INSTALL_PREFIX:PATH=${AIDGE_INSTALL} -DCMAKE_BUILD_TYPE=${OPT_BUILD_MODE} -DPYBIND=${OPT_WITH_PYBIND} -DTEST=${OPT_WITH_TESTS} -DENABLE_ASAN=${OPT_ASAN} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ${@} ..) $>" - cmake -DCMAKE_INSTALL_PREFIX:PATH=${AIDGE_INSTALL} -DCMAKE_BUILD_TYPE=${OPT_BUILD_MODE} -DPYBIND=${OPT_WITH_PYBIND} -DTEST=${OPT_WITH_TESTS} -DENABLE_ASAN=${OPT_ASAN} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ${@} .. + cmake -DCMAKE_INSTALL_PREFIX:PATH=${AIDGE_INSTALL} -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=${OPT_BUILD_MODE} -DPYBIND=${OPT_WITH_PYBIND} -DTEST=${OPT_WITH_TESTS} -DENABLE_ASAN=${OPT_ASAN} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ${@} .. make all install -j$(($(nproc) - 1)) if [[ "$OPT_BUILD_MODE" == "Debug" ]]; then ctest --output-on-failure || true diff --git a/version.txt b/version.txt index 0c62199f16ac1e2d7f7ae75b420c1231325dff4e..f4778493c50025c6ab147a1fec7486ef0c706792 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.1 +0.2.2 \ No newline at end of file