This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def Square(x): | |
time.sleep(0.1) | |
return x ** 2 | |
def Mul(x, y): | |
time.sleep(0.1) | |
return x * y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
OlderNewer