Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped references around structs #19

Merged
merged 2 commits into from
Jul 13, 2018
Merged

Wrapped references around structs #19

merged 2 commits into from
Jul 13, 2018

Conversation

anshuman23
Copy link
Owner

@josevalim, I have wrapped the references around appropriate structs as you had instructed. Is this fine?

Once you give the go-ahead, I'll make more changes and start removing C code that can easily be replicated in Elixir.


def load_nifs do
:erlang.load_nif("priv/Tensorflex", 0)
import Tensorflex.NIFs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to import them before using. import in Elixir is to invoke functions without the module name.

However, you could use aliases to avoid typing the Tensorflex. prefix everytime.

alias Tensorflex.{NIFs, Graph, Matrix, Tensor}

Now you can write NIFs.read_graph(filepath) instead of Tensorflex.NIFs.read_graph(filepath)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. Thank you for the input.

I've added this and I'm merging the latest code.

@josevalim
Copy link
Contributor

I have added one comment, everything else is great!

@anshuman23 anshuman23 merged commit 03e2a3c into master Jul 13, 2018
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