Giter Site home page Giter Site logo

ctorch's Introduction

ctorch

ctorch is a C binding to Pytorch C++. It can be used as base to build Pytorch binding in other languages. Here, it is for building ztorch a Pytorch binding for zig language.

Build library with make

libctorch.so will be built and saved at lib directory.

# clean up previous built library
make clean
make all

Build library with cmake

  • libctorch.so will be built and saved at cmake-output/lib
  • header files will be copied to cmake-output/include
cmake -B build -S .

cd build && make install

Build libary with zig build

zig build

Add it to your build.zig.zon.

    .ctorch = .{
        .url = "https://github.com/sugarme/ctorch/archive/a5a388a32d230a89a4a64d071657b6dd5e4e3bec.tar.gz",
        .hash = "122084941d6e06491a85e1356c7cca24a078103d34155e34a10a16a53f420d6bc399",
    },

Then it can be used in the consumer project build.zig file as

    const ctorch_dep = b.dependency("ctorch", .{
        .target = target,
        .optimize = optimize,
    });

    lib.linkLibrary(ctorch_dep.artifact("ctorch"));

ctorch's People

Contributors

sugarme avatar

Watchers

 avatar  avatar

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.