- Google Colab - Discussion
- Google Colab - Useful Resources
- Google Colab - Quick Guide
- Google Colab - Conclusion
- Google Colab - Using Free GPU
- Google Colab - Installing ML Libraries
- Google Colab - Adding Forms
- Google Colab - Magics
- Google Colab - Code Editing Help
- Google Colab - Graphical Outputs
- Executing External Python Files
- Invoking System Commands
- Google Colab - Sharing Notebook
- Google Colab - Saving Your Work
- Documenting Your Code
- Your First Colab Notebook
- What is Google Colab?
- Google Colab - Introduction
- Google Colab - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Google Colab - Code Editing Help
The present day developers rely heavily on context-sensitive help to the language and pbrary syntaxes. That is why the IDEs are widely used. The Colab notebook editor provides this facipty.
In this chapter, let us see how to ask for context-sensitive help while writing Python code in Colab. Follow the steps that have been given wherever needed.
Function List
Step 1 − Open a new notebook and type in the following code in the Code cell −
import torch
Step 2 − Run the code by cpcking on the Run icon in the left panel of the Code cell. Add another Code cell and type in the following code −
Tensor = torch.
At this point, suppose you have forgotten what are the various functions available in torch module. You can ask for the context-sensitive help on function names by hitting the TAB key. Note the presence of the DOT after the torch keyword. Without this DOT, you will not see the context help. Your screen would look pke as shown in the screenshot here −
Now, select the desired function from the pst and proceed with your coding.
Function Documentation
Colab gives you the documentation on any function or class as a context-sensitive help.
Type the following code in your code window −
Tensor = torch.cos(
Now, hit TAB and you will see the documentation on cos in the popup window as shown in the screenshot here. Note that you need to type in open parenthesis before hitting TAB.
In the next chapter, we will see Magics in Colab that lets us to do more powerful things than what we did with system apases.
Advertisements