Git Product home page Git Product logo

Comments (3)

wolfv avatar wolfv commented on May 18, 2024

With some of the recent additions this is definitly possible (at least for "easy" views that don't use the new islice), and for the strided view.

from xtensor-python.

yungyuc avatar yungyuc commented on May 18, 2024

I am interested in working on this. I wonder if there's a pointer (like a file or a PR) to the "easy" views that don't use the new islice?

My project needs to share large buffers among C++ and Python. It seems that, without the requested feature, xtensor-python always copies the buffer when an array is passed across the wrapper.

c = xt.C()
self.assertEqual([0.]*10, c.array.tolist())
# use __setitem__ implemented in C++ to set the element.
c[0] = 3
self.assertEqual([3.] + [0.]*9, c.array.tolist())
# c.array returns a copy while I want a view.
arr = c.array
arr[1] = 1
# FIXME: this assertion fails
self.assertEqual([3., 1.] + [0.]*8, c.array.tolist())

from xtensor-python.

JohanMabille avatar JohanMabille commented on May 18, 2024

The view mentioned here is the strided view. The idea would be to have a similar class in xtensor-python that embeds a xensor-python container and the python objetc for view

from xtensor-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.