Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a swift notebook on google colab

I have seen some nice demo on the dev summit on Swift for Tensorflow. So would like to try this out.

I could open this notebook:

https://github.com/tensorflow/swift/blob/master/docs/site/tutorials/custom_differentiation.ipynb

and if you view the nb runtime setting, the runtime type dropdown indicated "Swift".

enter image description here

However, I can't find anywhere in the colab menu how you can create a notebook thats swift from scratch.

like image 559
kawingkelvin Avatar asked Jan 26 '23 14:01

kawingkelvin


2 Answers

Presently, the simplest way is to create a copy of an existing swift notebook. Use the menu item File -> Save a copy in Drive...

like image 76
Bob Smith Avatar answered Jan 30 '23 01:01

Bob Smith


For those who want to do hack, or just upload a blank notebook thats configured to run Swift once it gets to Colab, here's maybe useful json snippets:

{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Blank for Swift.ipynb","version":"0.3.2","provenance":[{"file_id":"https://github.com/tensorflow/swift/blob/master/docs/site/tutorials/custom_differentiation.ipynb","timestamp":1552503857805}],"collapsed_sections":[]},"kernelspec":{"name":"swift","display_name":"Swift"},"accelerator":"GPU"},"cells":[{"metadata":{"id":"iROrFnecc1gX","colab_type":"code","colab":{}},"cell_type":"code","source":[""],"execution_count":0,"outputs":[]}]}
like image 29
kawingkelvin Avatar answered Jan 30 '23 00:01

kawingkelvin