This file contains 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
/* | |
* SPDX-License-Identifier: MIT | |
* MIT License | |
* | |
* Copyright (c) 2019 Western Digital Corporation or its affiliates. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. |
This file contains 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
def schedule_conv2d_2(_,outs,target): | |
"""Create schedule for tensors""" | |
s = tvm.create_schedule([x.op for x in outs]) | |
scheduled_ops = [] | |
def traverse(op): | |
"""Traverse operators from computation graph""" | |
# inline all one-to-one-mapping operators except the last stage (output) | |
if 'broadcast' in op.tag: | |
if op not in s.outputs: |
This file contains 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 requests | |
from bs4 import BeautifulSoup | |
import sys | |
from opencc import OpenCC | |
def s2t(text): | |
cc = OpenCC('s2t') | |
converted = cc.convert(text) | |
return converted |
This file contains 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 mxnet as mx | |
import numpy as np | |
from mxnet import gluon, nd | |
from mxnet import autograd as ag | |
from mxnet.gluon import nn | |
from mxnet.gluon.model_zoo import vision as models | |
from mxnet.gluon.data import vision | |
from mxnet.gluon.data.vision import transforms | |
import shutil |
This file contains 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 | |
import numpy | |
import timeit | |
n = 225 | |
A = tvm.placeholder((n, n), name='Input') | |
B = tvm.placeholder((7, 7), name='Filter') | |
di = tvm.reduce_axis((0, 7), name='di') | |
dj = tvm.reduce_axis((0, 7), name='dj') | |
C = tvm.compute( |
This file contains 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
#-------------------------------------------------------------------- | |
# Template custom cmake configuration for compiling | |
# | |
# This file is used to override the build options in build. | |
# If you want to change the configuration, please use the following | |
# steps. Assume you are on the root directory. First copy the this | |
# file so that any local changes will be ignored by git | |
# | |
# $ mkdir build | |
# $ cp cmake/config.cmake build |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
.text | |
.file "fuse_reshape" | |
.globl fuse_reshape # -- Begin function fuse_reshape | |
.p2align 2 | |
.type fuse_reshape,@function | |
fuse_reshape: # @fuse_reshape | |
.cfi_startproc | |
# %bb.0: # %entry | |
addi sp, sp, -16 | |
.cfi_def_cfa_offset 16 |
This file contains 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
FROM ubuntu:18.04 | |
MAINTAINER BeMg | |
RUN apt-get update && apt-get install -y git autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk \ | |
build-essential bison flex device-tree-compiler texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev && mkdir risc-v | |
ENV RISCV /risc-v | |
RUN cd ~ && git clone -b rvv-0.7.x --recursive https://github.com/riscv/riscv-gnu-toolchain && \ | |
cd riscv-gnu-toolchain && ./configure --prefix=$RISCV --with-arch=rv64gcv --with-abi=lp64 && make -j4 | |
ENV PATH="/risc-v/bin:${PATH}" | |
RUN cd ~ && git clone https://github.com/riscv/riscv-pk.git && \ |
This file contains 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
Chain INPUT (policy ACCEPT) | |
target prot opt source destination | |
ufw-before-logging-input all -- 0.0.0.0/0 0.0.0.0/0 | |
ufw-before-input all -- 0.0.0.0/0 0.0.0.0/0 | |
ufw-after-input all -- 0.0.0.0/0 0.0.0.0/0 | |
ufw-after-logging-input all -- 0.0.0.0/0 0.0.0.0/0 | |
ufw-reject-input all -- 0.0.0.0/0 0.0.0.0/0 | |
ufw-track-input all -- 0.0.0.0/0 0.0.0.0/0 | |
Chain FORWARD (policy ACCEPT) |