Skip to content

libtorch C++ jni#2

Open
nazarblch wants to merge 3 commits into
botkop:masterfrom
nazarblch:master
Open

libtorch C++ jni#2
nazarblch wants to merge 3 commits into
botkop:masterfrom
nazarblch:master

Conversation

@nazarblch
Copy link
Copy Markdown

The main changes:

  1. Tensor methods (https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/core/Tensor.h) and torch Functions.h are partially wrapped into Scala API (in src/main/scala/torch_scala/api).
  2. Tensor and Variable classes have been made generic (Tensor[T, TT] and Variable[T, TT]) with templates T corresponded to data type and TT corresponded to device type (example Tensor[Float, CUDA] or Tensor[Int, CPU])
  3. Tensor has implicit wrappers in src/main/scala/torch_scala/api/aten/functions, including MathBackward.scala for backward methods.
  4. Sbt plugin for JNI code generation JniGeneratorPlugin and sbt plugin for cmake so lib building JniBuildPlugin in project directory.
  5. The old scorch code is partially adapted and completion are required.

@koen-dejonghe
Copy link
Copy Markdown
Member

Thank you very much for your code. I will definitely have a look at it. Keep you posted.

@koen-dejonghe
Copy link
Copy Markdown
Member

Is it possible to build without GPU support?

@nazarblch
Copy link
Copy Markdown
Author

nazarblch commented Apr 4, 2019 via email

@koen-dejonghe
Copy link
Copy Markdown
Member

I created a gitter room. The button is on the readme. We can discuss there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants