anshuman23 / tensorflex

Tensorflow bindings for the Elixir programming language :muscle:
https://hexdocs.pm/tensorflex/Tensorflex.html
Apache License 2.0
308 stars 14 forks source link

Added tensor support for strings and for getting TF_DataType #7

Closed anshuman23 closed 6 years ago

anshuman23 commented 6 years ago

@josevalim, In this PR I have added some functions that were working perfectly. However I have actually been devoting a lot of time to getting TF_INT64 and TF_FLOAT tensors (especially multi-dimensional ones) to work in Elixir. I will add PRs for those soon, once I get them to work completely.

In this PR, the functionalities added are:

An example for these functions is as follows:

iex(1)> tensor = Tensorflex.string_tensor "string tensors work!"
#Reference<0.697833995.47579139.50516>

iex(2)> tensor2 = Tensorflex.string_tensor 123
{:error, :non_binary_argument}

iex(3)> Tensorflex.tensor_datatype tensor
{:ok, :tf_string}