From 752cc8d16a6b461b32b912e3e3cd491e561e4dab Mon Sep 17 00:00:00 2001 From: Sam-Armstrong Date: Fri, 13 Sep 2024 01:10:16 +0100 Subject: [PATCH] add kornia.geometry.liegroup.So3 transpilation to nightly binaries tests --- .github/workflows/test-nightly-binaries.yml | 1 + examples_and_demos/kornia_So3.ipynb | 51 +++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 examples_and_demos/kornia_So3.ipynb diff --git a/.github/workflows/test-nightly-binaries.yml b/.github/workflows/test-nightly-binaries.yml index 9bff9d00..680ab300 100644 --- a/.github/workflows/test-nightly-binaries.yml +++ b/.github/workflows/test-nightly-binaries.yml @@ -14,6 +14,7 @@ jobs: resnet_demo_cpu, lstm_torch_to_tensorflow_cpu, kornia_demo, + kornia_So3, ] steps: diff --git a/examples_and_demos/kornia_So3.ipynb b/examples_and_demos/kornia_So3.ipynb new file mode 100644 index 00000000..03acd2aa --- /dev/null +++ b/examples_and_demos/kornia_So3.ipynb @@ -0,0 +1,51 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install -q ivy kornia" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import ivy\n", + "import tensorflow as tf\n", + "import kornia" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "TranspiledQuaternion = ivy.transpile(kornia.geometry.quaternion.Quaternion, source=\"torch\", target=\"tensorflow\")\n", + "TranspiledSo3 = ivy.transpile(kornia.geometry.liegroup.So3, source=\"torch\", target=\"tensorflow\")\n", + "\n", + "quaternion_data = tf.convert_to_tensor([1., 0., 0., 0.])\n", + "transpiled_quaternion = TranspiledQuaternion(quaternion_data)\n", + "transpiled_so3 = TranspiledSo3(transpiled_quaternion)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}