Skip to content

Instantly share code, notes, and snippets.

git clone https://github.com/ebrevdo/tensorflow tensorflow_ebrevdo
cd tensorflow_ebrevdo
docker build -t "tf-pi" -f tensorflow/tools/ci_build/Dockerfile.cpu tensorflow/tools/ci_build/
docker run -it tf-pi
# All commands after this are run on the Docker instance.
git clone https://github.com/ebrevdo/tensorflow
sudo dpkg --add-architecture armhf
echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty main universe" \
sudo tee -a /etc/apt/sources.list.d/armhf.list
sudo apt-get update
sudo apt-get install -y curl openjdk-8-jdk swig python3-numpy python3-dev python3 python-virtualenv python3-virtualenv swig zlib1g-dev
cd ~
mkdir projects
virtualenv -p python3 --system-site-packages projects
cd ~/projects
git clone https://github.com/neo-titans/odroid
sudo fallocate -l 1G /swapfile
#!/bin/bash
# Script for building TensorFlow and its dependencies on the Nvidia TX1. Based on
# https://github.com/neo-titans/odroid
sudo apt-get install -y curl openjdk-8-jdk swig python3-numpy python3-dev swig zlib1g-dev
git clone https://github.com/neo-titans/odroid
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
mkdir ~/projects
cd ~/projects
git clone --recurse-submodules https://github.com/petewarden/tensorflow_ios.git tensorflow_ios
cd tensorflow_ios
mkdir tools
mkdir tools/objc
echo '
filegroup(
name = "default_provisioning_profile",
srcs = ["default_provisioning_profile.mobileprovision"],
@petewarden
petewarden / ..build-protobuf-3.0.0.md
Last active September 27, 2022 08:19 — forked from BennettSmith/..build-protbuf-2.5.0.md
Script used to build Google Protobuf 3.0.0 for use with Xcode 7 / iOS 9. Builds all supported architectures and produces a universal binary static library.

Google Protobuf 3.0.1 - Mac OS X and iOS Support

The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simulator.

This gist was adapted from the original at https://gist.github.com/BennettSmith/7150245, and updated to deal with Xcode 7 and iOS 9, and download protobuf version 3.0.0.

void ReferenceEightBitIntGemm(bool transpose_a, bool transpose_b,
bool transpose_c, int m, int n, int k,
const uint8_t* a, int32_t a_offset, int lda,
const uint8_t* b, int32_t b_offset, int ldb,
uint8_t* c, int32_t c_offset, int32_t c_mult_int,
int32_t c_shift, int ldc) {
assert((c_shift >= 0) && (c_shift <= 32));
assert(a != nullptr);
assert(b != nullptr);
// Runs a small set of hand-calculated data through the implementation.
void TestWithSmallData() {
const int m = 4;
const int n = 2;
const int k = 3;
// Matrix A (LHS) is:
// | 7 | 10 | 13 | 16 |
// | 8 | 11 | 14 | 17 |
// | 9 | 12 | 15 | 18 |
const uint8_t a_data[] = {7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
// Call like wrapNamespaceInTracing(jetpac, 'jetpac');
g_callStack = [];
window.onerror = function(inputMessage, url, line) {
if (typeof g_callStack !== 'undefined') {
inputMessage += ' - stack=[' + g_callStack.join(' -> ') + ']';
g_callStack = [];
}
var message = '**** Javascript error **** ' + inputMessage + ' at ' + url + ':' + line;
console.log(message);
@petewarden
petewarden / tumblrproxy.rb
Created October 25, 2012 03:28
An example of proxying a Tumblr blog as a subdirectory in Ruby and Sinatra
get '/blog*' do
path = params[:splat][0]
source_url = 'http://yourblog.tumblr.com' + path.gsub(/ /, '+')
source_content_type = ''
source_body = open(source_url) do |f|
source_content_type = f.content_type # "text/html"
f.read
end
if source_content_type == 'text/html'
output_base = request.base_url + '/blog'
@petewarden
petewarden / smoketest.rb
Created December 8, 2011 21:58
A simple smoketest script for sanity checking websites from the command line
#!/usr/bin/ruby
#
# A module for a quick sanity test on whether a web page is working (for small values of working)
# See http://petewarden.typepad.com for more info
#
#
require 'rubygems' if RUBY_VERSION < '1.9'
require 'net/http'
require 'net/https'