# TensorFlow - Hello World

**URL:** https://talk.remobjects.com/t/tensorflow-hello-world/20946
**Category:** Oxygene
**Tags:** island
**Created:** [December 15, 2019, 2:10am UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946 "2019-12-15T02:10:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![wuping](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/5f8ce5/32.png) [@wuping](https://talk.remobjects.com/u/wuping)
#### Post date: [December 15, 2019, 2:10am UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/1 "2019-12-15T02:10:35Z")

</div>

Thanks to @mh, I was able to [import TensorFlow C-API into Island](https://talk.remobjects.com/t/how-to-import-c-files-h-c-in-oxygene/12928/23).

Python is TensorFlow most-preferred language. But TensorFlow also has low-level C-APIs for binding with other languages.

RemObjects Island (Oxygene, Swift, C#) provide **better** alternatives than C, because we could have a **strong-typed binding** to TensorFlow while still enjoying all of the **modern language features**!

And, here is the **world’s first TensorFlow Hello World in Oxygene** :

> <https://gist.github.com/wxinix/0a907b81865387e8a4bb4e35a83e0a37>

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 15, 2019, 12:22pm UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/2 "2019-12-15T12:22:11Z")

</div>

Cool! can’t wait to see what you do with it!

FTR, starting with vNext (some EBuild fixes/extensions were needed), anyone can pull in the pre-imported TensorFlow library, just by adding the following reference to your project.

`<RemoteProjectReference Include="github.com/remobjects/recipes/TensorFlow/TensorFlow.elements"/>`

@wuping, since the API (being C) is very low-level and non-OOP, are you planning to implement a higher-level abstraction on top of it to expose it a more OOP way? If so, I’d love to be in the loop for that and maybe get it made available to everybody as well, once ready.

—marc

---

<div class="post-metadata">

### Author: ![wuping](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/5f8ce5/32.png) [@wuping](https://talk.remobjects.com/u/wuping)
#### Post date: [December 15, 2019, 7:31pm UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/3 "2019-12-15T19:31:52Z")

</div>

> [@mh](#):
>
> since the API (being C) is very low-level and non-OOP, are you planning to implement a higher-level abstraction on top of it to expose it a more OOP way?

@mh Thank you Marc! Will definitely keep you in the loop.

Yes I did plan to have some “high-level abstraction in OOP way”, but it is going to be **minimal** for the convenience of our research project. We would still use Python to build (prototype) the TensorFlow model, while in the production system, we will just load the model using C-API or any compatible RemObjects languages. The truth is - It is almost (economically) impossible to fully replace the existing Python framework.

TensorFlow can be used as a **plain Computation Graph library** equipped with highly optimized CPU/GPU computation engine . In that sense, it provides **a transparent bridge** for RemObjects/Island to the GPU computing world without touching the dirty details of CUDA or OpenCL programming.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 15, 2019, 8:58pm UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/4 "2019-12-15T20:58:50Z")

</div>

> [@wuping](#):
>
> @mh Thank you Marc! Will definitely keep you in the loop.
> 
> Yes I did plan to have some “high-level abstraction in OOP way”, but it is going to be **minimal** for the convenience of our research project. We would still use Python to build (prototype) the TensorFlow model, while in the production system, we will just load the model using C-API or any compatible RemObjects languages. The truth is - It is almost (economically) impossible to fully replace the existing Python framework.
> 
> TensorFlow can be used as a **plain Computation Graph library** equipped with highly optimized CPU/GPU computation engine . In that sense, it provides **a transparent bridge** for RemObjects/Island to the GPU computing world without touching the dirty details of CUDA or OpenCL programming.

Thats very cool! I must admit I’m a bit behind with getting into the two whole ML scape, myself, but there’s a lot of potential there.

---

<div class="post-metadata">

### Author: ![arturredzko](https://talk.remobjects.com/user_avatar/talk.remobjects.com/arturredzko/32/16908_2.png) [@arturredzko](https://talk.remobjects.com/u/arturredzko)
#### Post date: [December 16, 2019, 8:08am UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/5 "2019-12-16T08:08:57Z")

</div>

I found these Delphi implementations :

> **[Laex/Delphi-Artificial-Neural-Network-Library](https://github.com/Laex/Delphi-Artificial-Neural-Network-Library)**
>
> Delphi wrapper for Artificial Neural Network Library (FANN, TensorFlow) - Laex/Delphi-Artificial-Neural-Network-Library

  

> **[hartmutdavid/TensorFlow4Delphi](https://github.com/hartmutdavid/TensorFlow4Delphi)**
>
> TensorFlow API (Wrapper) for Delphi. Contribute to hartmutdavid/TensorFlow4Delphi development by creating an account on GitHub.

  
The last one implements low-level and higher-level API.

---

<div class="post-metadata">

### Author: ![wuping](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/5f8ce5/32.png) [@wuping](https://talk.remobjects.com/u/wuping)
#### Post date: [December 16, 2019, 2:38pm UTC](https://talk.remobjects.com/t/tensorflow-hello-world/20946/6 "2019-12-16T14:38:10Z")

</div>

> [@arturredzko](#):
>
> found these Delphi implementations

@arturredzko  
Thank you for the heads up. Yes I was aware of these two great Delphi implementations.

I guess the at least one advantage of Element/Island is **cross-language compatibility** (like mixing Oxygene and C#) on Windows and Linux platform, with all those modern language features. This means, **once** you have **a properly designed higher-level OOP abstraction in one language** , **other languages automatically have that abstraction too**.
