Skip to content

Instantly share code, notes, and snippets.

@lcf87
lcf87 / TFDebug.md
Last active July 3, 2024 04:37
Debugging the TensorFlow internals

If you want to be able to debug CUDA kernels, this isn't for you

There are tons and tons of tutorials teaching you how to debug the TensorFlow Python APIs, which is good. But there is nearly zero converage anywhere on how to debug the internals of TensorFlow. By internals I mean everything under the Python layer, i.e. the C and C++ runtime library.

Here I'll show you how to setup the environment to debug, and how to use gdb to see under the hood of TensorFlow. But before we start, I have to mention this open source book. It covered so many internal workings of TensorFlow and is definitely worth reading. But sadly it doesn't have an official English version. You can go to the issue page and there's a thread mentioning a Google translated version. I still find it useful, despite kinda hard to read.

Let's get down to it.

Compiling

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active March 28, 2026 20:04
set -e, -u, -o, -x pipefail explanation
@njujerry
njujerry / 天涯房事
Last active July 6, 2022 06:05
总list
实在对不住,真的被删了。可惜了。真是神贴中的上品,惊人的精彩。给你发个我的感想,赶紧看,不然也会被删。
根据自己判断,评天涯房观神贴榜,仅做参考。重新整理,略有增删。第三次发。不全,见谅。截至2015年(神贴需时间验证)。基本以时间先后为序。
评判神贴的标准,1,预测准确,须是首要。必经过时间检验。泥沙淘尽,始见明珠。看空贴皆错,没法入选。2,合理性。论据需充分,论理宜恰当。只给出一个结论,有可能是乱猜。3,知识性。虽言房产问题,人生观,历史感,金融,人类发展史等等,包罗万象。4,对现实的指导意义及参考价值。5人品。不知是否为庙堂之人,都却有栋梁之才。
1,“征税加息降房价”--荒谬的理论、恐怖的圈套(及其他)。作者“孤独的思想”。发布于2006。此贴发布非常之早。简单明了,深刻地阐述分析了政策和房价的关系,指出房产税不能降房价,正确判断了十几年的房价走势。此贴有开玄启明之功。排名第一的理由是,发帖最早,作者无房。立场公正。
2,“因为贱,所以生活艰辛!说出真相,底层会更绝望”。作者“大鹏金翅明王”。发布于2010年。此贴类似于上贴。从人性和社会本质阐述了房地产的真相,有28理论,丛林理论。文笔犀利,看似冷酷无情,实则仁慈温厚,胸怀广阔。
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active October 29, 2025 19:24
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@rocarvaj
rocarvaj / .vimrc
Created April 27, 2012 21:28
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)