Skip to content

Instantly share code, notes, and snippets.

View ranr01's full-sized avatar

Ran Rubin ranr01

  • Ctrl-labs
View GitHub Profile
@ranr01
ranr01 / Dell_Precision_5520_install.md
Last active March 22, 2021 15:12
How to install TensorFlow with GPU support on a Ubuntu Dell Precision 5520

Here we will set up a Ubuntu Dell Precision 5520 with Ubuntu 18.04, and TensorFlow with GPU support.

Information collected from several sources cited below.

  1. Upgrade to Ubuntu 18.04

    1. Open a terminal and start with:

$ sudo apt update

@ranr01
ranr01 / engine_iterrupt.ipynb
Last active May 25, 2018 02:52
Interrupt running tasks in IpyParallel engines
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ranr01
ranr01 / IpyparallelDynamicInitializer.ipynb
Created March 22, 2018 18:10
Dynamic engine initialization for Ipyparallel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ranr01
ranr01 / Exposing raw C++ buffers as NumPy arrays using Pybind11.md
Last active November 27, 2022 19:45
Exposing raw C++ buffers as NumPy arrays using Pybind11

Exposing raw C++ buffers as NumPy arrays using Pybind11

Sometimes you have to work with C++ libraries that use raw pointers and arrays that you need to have access to from python. Indeed, working with C styles arrays is sometimes considered bad practice but many people still do...

The solution here is for the C++ side to provide the raw memory address of the data buffer, and then use numpy's array interface mechanism to create an ndarray that uses this buffer.

This allows the user to view and change elements of the buffers with no copies in a way that is visible to both C++ and Python sides.