Skip to content

Instantly share code, notes, and snippets.

View bwasti's full-sized avatar

Bram Wasti bwasti

View GitHub Profile
#!/bin/bash
echo "***** pasted with pastedir *****" > /tmp/_pastedirout
echo "" >> /tmp/_pastedirout
find $1 -type f -not -path '*/\.*' -exec bash -c 'echo ------ $1 ------ && cat $1' _ {} \; >> /tmp/_pastedirout
curl -s --data code="$(cat /tmp/_pastedirout)" https://api.teknik.io/v1/Paste | sed 's/.*\"url\":\"\([^\"]*\)\".*/\1/g'
#!/bin/bash
echo "***** pasted with pastedir *****" > /tmp/_pastedirout
echo "" >> /tmp/_pastedirout
find "${@: -1}" -type f -not -path '*/\.*' -exec bash -c 'echo ------ $1 ------ && cat $1' _ {} \; >> /tmp/_pastedirout
curl -s --data code="$(cat /tmp/_pastedirout)" https://api.teknik.io/v1/Paste | sed 's/.*\"url\":\"\([^\"]*\)\".*/\1/g'
echo "***** pasted with pastedir *****" > /tmp/_pastedirout
echo "" >> /tmp/_pastedirout
find "${@: -1}" -type f -not -path '*/\.*' -exec bash -c 'echo ------ $1 ------ && cat $1' _ {} \; >> /tmp/_pastedirout
curl -s --data code="$(cat /tmp/_pastedirout)" https://api.teknik.io/v1/Paste | sed 's/.*\"url\":\"\([^\"]*\)\".*/\1/g'
echo "***** pasted with pastedir *****" > /tmp/_pastedirout
echo "" >> /tmp/_pastedirout
find . -type f -not -path '*/\.*' -exec bash -c 'echo ------ $1 ------ && cat $1' _ {} \; >> /tmp/_pastedirout
curl -s --data code="$(cat /tmp/_pastedirout)" https://api.teknik.io/v1/Paste | sed 's/.*\"url\":\"\([^\"]*\)\".*/\1/g'
/* @file arm_bench.cc
* @author bwasti
* @brief Simple benchmarking suite for a couple different ARM instructions.
*
* To add an instruction to be tested see the RUN_ITERS macro, which finds
* the minimum time over a sequence of runs[0]. See usage below.
*
* To use this file standalone just compile it:
*
* gcc -O2 arm_bench.c -o arm_bench
class Agent(object):
def __init__(self, bank, init_policy=2.5):
self.policy = random.uniform(0, init_policy * 2)
self.bank = bank
def declared_price(self, intrinsic_cost):
self.cost = intrinsic_cost
self.price = max(self.policy * self.cost, 0)
return self.price
for iteration in range(iters * batch_size):
# Create a graph with random weights
G = nx.complete_graph(num_nodes, nx.DiGraph())
# ... add random weights ...
# Give an edge to a sample of agents (not all are going to be playing)
players = random.sample(agents, len(G.edges))
# Calculate the shortest path
path = nx.shortest_path(G, source=source, target=sink, weight="price")
import time
def Square(x):
time.sleep(0.1)
return x ** 2
def Mul(x, y):
time.sleep(0.1)
return x * y
import tvm
from tvm import relay
import torch
import torch.nn.functional as F
import inspect
import ast
import numpy as np
_parsed_functions = dict()
diff --git a/include/tvm/runtime/c_runtime_api.h b/include/tvm/runtime/c_runtime_api.h
index 1a1a8da6..2e15b179 100644
--- a/include/tvm/runtime/c_runtime_api.h
+++ b/include/tvm/runtime/c_runtime_api.h
@@ -85,6 +85,7 @@ typedef enum {
kStr = 11U,
kBytes = 12U,
kNDArrayContainer = 13U,
+ kManagedArrayHandle = 14U,
// Extension codes for other frameworks to integrate TVM PackedFunc.