Skip to content

[Docs] Add Google Colab support to tutorials #10706

@guberti

Description

@guberti

Add "Open in Google Colab" button to .ipynb tutorials

On Tensorflow's doc sites, each interactive tutorial has a one-click open to open it on Google Colab - Google's interactive web editor for Python notebooks. See this example for post training integer quantization (screenshot below).
image

I'm currently messing around with some microTVM tutorials, so I'll see if I can get a demo of this running there. "Open in Colab" is one of my favorite things about the Tensorflow and Keras docs, and I'd love to integrate the feature here too.

Additions/Changes Requested

While the buttons look fancy, each is just a URL underneath. The "view source on Github" link is just a hardcoded URL to the Github repo - nothing fancy. For the open in Colab button, we just take that same hardcoded URL, but prepend "colab.research.google.com" and Colab takes care of the rest. Here's the link that powers the button above:

https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/performance/post_training_integer_quant.ipynb

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions