Coder Social home page Coder Social logo

tensorswift's Introduction

TensorSwift: High-Performance Tensor Arithmetic

A very basic tensor engine done as part of course work in cisc830

Prerequisite

sudo apt-get install python3-dev

Check if pybind exists

python3 -m pybind11 --includes

If not exists

pip3 install --no-cache-dir pybind11

Build

To build

with openmp support (for cpu acceleration)

make OMP=1

without openmp support

make

To control number of thread employed for parallelization, do following modification in ts.h

#define SYS_PARAM_CPUCOUNT 8

change the number according to your system's core count

Output will be an executable file tensorswift.cpython-38-x86_64-linux-gnu.so (depends on python version)

To clean outputs

make clean

Example usage

From the same folder where tensorswift.cpython-38-x86_64-linux-gnu.so exists

Check if tensorswift found,

python3 -c "import tensorswift"

Currently two class exists in the module,

  1. Data (a simple int wrapping class with basic four operation support)
  2. SwiftTensor, ongoing work, buffer contains garbage, size is in uint64_t and means number of element, arbitrary dimension should work, only floating number hold

Example import

a = tensorswift.Data(1)
b = tensorswift.Data(2)

print(a)
print(b)

c = a+b
# empty tensor
a = tensorswift.SwiftTensor()
# tensor with shape [1,2]
b = tensorswift.SwiftTensor([1,2])

example code can be found in example.py

tensorswift's People

Contributors

jaiaid avatar kevinassogba avatar

Watchers

 avatar

tensorswift's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.