Giter VIP home page Giter VIP logo

Comments (2)

Huelse avatar Huelse commented on September 24, 2024

可能和python2.7的库不支持lambda函数有关,你可以在wrapper.cpp的120行看到,这里是用lambda函数包装的,尝试把这里改为和其他普通函数绑定的那样子试试。

from seal-python.

yuntaobc avatar yuntaobc commented on September 24, 2024

仔细看了看120行定义,翻了下seal的modulus.h,发现这个Batching()是个静态函数

//modulus.h,
SEAL_NODISCARD static inline SmallModulus Batching(

于是改了下wrapper.cpp120和121行,把 .def换成了.def_static,python2.7和python3封装都后,5_rotation.py都可以正常运行了,没报错.

//wrapper.cpp
.def_static("Batching", [](std::size_t poly_modulus_degree, int bit_size) { return PlainModulus::Batching(poly_modulus_degree, bit_size); })
.def_static("Batching", [](std::size_t poly_modulus_degree, std::vector<int> bit_sizes) { return PlainModulus::Batching(poly_modulus_degree, bit_sizes); });

谢谢解答奥

from seal-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.