We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac3e85a commit 5e45f71Copy full SHA for 5e45f71
flaxlib/flaxlib/__init__.py
@@ -12,4 +12,4 @@
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
-from flaxlib.flaxlib import sum_as_string as sum_as_string
+from flax.flaxlib.flaxlib_cc import sum_as_string as sum_as_string
flaxlib/flaxlib/flaxlib.pyi renamed to flaxlib/flaxlib_cc.pyi
flaxlib/src/lib.cc
@@ -0,0 +1,13 @@
1
+#include <string>
2
+
3
+#include "third_party/nanobind/include/nanobind/nanobind.h"
4
5
+namespace flaxlib {
6
+std::string sum_as_string(int a, int b) {
7
+ return std::to_string(a + b);
8
+}
9
10
+NB_MODULE(flaxlib_cc, m) {
11
+ m.def("sum_as_string", &sum_as_string);
+} // namespace flaxlib
0 commit comments