Skip to content

Instantly share code, notes, and snippets.

use std::ops::Add;
#[derive(Debug)]
pub enum Expr<'a> {
Constant(f32),
// ^^^--this is a simplified version. In the real version,
// Constant holds large matrices and I would like to
// avoid copying it.
Add(&'a Node<'a>, &'a Node<'a>),
}
@ethanabrooks
ethanabrooks / tf_profile.py
Created February 8, 2017 19:11
This script generates a file called 'timeline.json.' If you navigate to [](chrome://tracing/) in a browser and load this file, the browser will display a runtime and memory profile of the program.
import io
import tensorflow as tf
from tensorflow.python.client import timeline
x = tf.constant([1, 2])
y = tf.constant([3, 4])
res = tf.reduce_sum(x * y)
# Run the graph with full trace option
with tf.Session() as sess:
~/tensorflow master* 1m 35s
❯ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 1 target...
INFO: From Compiling external/protobuf/python/google/protobuf/pyext/descriptor_database.cc:
external/protobuf/python/google/protobuf/pyext/descriptor_database.cc:84:44: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
PyObject_CallMethod(py_descriptor, "SerializeToString", NULL));
^
external/protobuf/python/google/protobuf/pyext/descriptor_database.cc:114:21: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
~/MalmoPlatform/build master* ⇣ 1m 56s
❯ ctest
Test project /Users/ethan/MalmoPlatform/build
Start 1: CppTests_create_tcp_server
1/142 Test #1: CppTests_create_tcp_server ..................................... Passed 0.02 sec
Start 2: CppTests_test_agent_host
2/142 Test #2: CppTests_test_agent_host ....................................... Passed 0.03 sec
Start 3: CppTests_test_argument_parser
3/142 Test #3: CppTests_test_argument_parser .................................. Passed 0.01 sec
Start 4: CppTests_test_client_server
import os
import shutil
from os.path import expanduser
import tensorflow as tf
summ = tf.summary.scalar('rand', tf.random_uniform(()))
summary_path = expanduser('~/tf_summaries')
if os.path.exists(summary_path):
shutil.rmtree(summary_path)
==18112== Memcheck, a memory error detector
==18112== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==18112== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==18112== Command: python helloworld.py
==18112==
==18112== Invalid read of size 4
==18112== at 0x545B31: PyObject_Free (in /home/ethan/rl_kit/env/bin/python3)
==18112== by 0x535DE9: ??? (in /home/ethan/rl_kit/env/bin/python3)
==18112== by 0x41F64F: PyImport_ImportFrozenModuleObject (in /home/ethan/rl_kit/env/bin/python3)
==18112== by 0x41F6B3: PyImport_ImportFrozenModule (in /home/ethan/rl_kit/env/bin/python3)
<sdf version='1.4'>
<world name='default'>
<light name='sun' type='directional'>
<cast_shadows>1</cast_shadows>
<pose frame=''>0 0 10 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.1 0.1 0.1 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Name: reactive-banana-wx
Version: 1.1.1.0
Synopsis: Examples for the reactive-banana library, using wxHaskell.
Description:
This library provides some GUI examples for the @reactive-banana@ library,
using wxHaskell.
.
Note: You need to install the (platform independent)
@cabal-macosx@ library before you can configure/build and install this library.
.
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Array.Repa as R
import Data.Array.Repa (Array, DIM1, (+^), D, Z(..), (:.)(..), (!))
import Data.Conduit (($$), (=$=), Source, Producer, Conduit)