Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ruslo's full-sized avatar

Ruslan Baratov ruslo

  • Bali
  • 13:31 (UTC +08:00)
View GitHub Profile
@ruslo
ruslo / check_format.sh
Created February 6, 2024 08:35
Script to run ClangFormat
#!/bin/bash
# Template: https://gist.github.com/ruslo/09b3e10a21522d43c354d5eb6299f22d
set -e
if [ ! $# -eq 0 ];
then
echo "Unexpected arguments: '$*'"
exit 1
@ruslo
ruslo / bash_script.sh
Created February 5, 2024 12:17
Template bash script file
#!/bin/bash
# Exit immediately if command returns a non-zero status.
# Do not move it to shebang since it will be ignored
# if run by "/bin/bash ./bash_script.sh"
set -e
# No arguments are expected, so exit with an error if anything is provided
# https://unix.stackexchange.com/a/25947
if [ ! $# -eq 0 ];
@ruslo
ruslo / main.cpp
Created September 21, 2023 06:43
CGAL::intersection failed with "Holes of the PWH intersect amongst themselves or with outer boundary" error
#include <CGAL/Boolean_set_operations_2.h> // CGAL::intersection
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
using kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using polygon_2 = CGAL::Polygon_2<kernel>;
using traits = CGAL::Polygon_set_2<kernel>::Traits_2;
using point_2 = kernel::Point_2;
using polygon_with_holes = CGAL::Polygon_with_holes_2<kernel>;
"""
.. _tutorial-from-mxnet:
Compile MXNet Models
====================
**Author**: `Joshua Z. Zhang <https://zhreshold.github.io/>`_
This article is an introductory tutorial to deploy mxnet models with NNVM.
For us to begin with, mxnet module is required to be installed.
... [ain Thread] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
... [16-5323222] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-183.5429.30.34.5341121, 27 Feb 2019 22:38)
... [16-5323222] INFO - #com.intellij.idea.Main - OS: Linux (4.15.0-46-generic, amd64)
... [16-5323222] INFO - #com.intellij.idea.Main - JRE: 1.8.0_152-release-1343-b16-5323222 (JetBrains s.r.o)
... [16-5323222] INFO - #com.intellij.idea.Main - JVM: 25.152-b16-5323222 (OpenJDK 64-Bit Server VM)
... [16-5323222] INFO - #com.intellij.idea.Main - JVM Args: -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djna.nosys=true -Djna.boot.library.path= -da -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.

Ubuntu

> lsb_release -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:     Ubuntu 18.04.2 LTS
Release:         18.04

macOS

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G5019
import tvm
import os
def prepare_test_libs(base_path):
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B')
s = tvm.create_schedule(B.op)
s[B].bind(B.op.axis[0], tvm.thread_axis("blockIdx.x"))
/*!
* Copyright (c) 2017 by Contributors
* \brief Example code on load and run TVM module.s
* \file cpp_deploy_example.cc
*/
#include <cstdio>
#include <dlpack/dlpack.h>
#include <tvm/runtime/module.h>
#include <tvm/runtime/registry.h>
#include <tvm/runtime/packed_func.h>
/*!
* Copyright (c) 2017 by Contributors
* \brief Example code on load and run TVM module.s
* \file cpp_deploy_example.cc
*/
#include <cstdio>
#include <dlpack/dlpack.h>
#include <tvm/runtime/module.h>
#include <tvm/runtime/registry.h>
#include <tvm/runtime/packed_func.h>