This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_colab_usage(pip_install=False, import_libs=True, return_fn=True): | |
""" Retrieve Google Colab Resource Utilization Stats | |
Args: | |
pip_install (bool, optional): Whether to preform pip installs | |
import_libs (bool, optional): Whether to import libraries | |
return_fn (bool, optional): Whether or not to return get_usage fn | |
Returns: | |
The get_usage fn ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def see_object_methods_and_docs(obj): | |
""" Function to retrieve an objects methods & respective docs | |
Args: | |
obj (object): The object instantiated from the class for | |
which we would like to reveal information regarding. | |
i.e. If the class is `Cat` and the object is `jimmy_the_cat` | |
than we pass `jimmy_the_cat` into this function to reveal | |
that the `Cat` class has the `meow` method and also the | |
related documentation for the `meow` method. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# version 2.1.0 | |
import tensorflow as tf | |
# version 1.18.1 | |
import numpy as np | |
# ######## DEFINE CUSTOM FUNCTION FOR TF LAMBDA LAYER ######## # | |
def resize_like(input_tensor, ref_tensor): | |
""" Resize an image tensor to the same size/shape as a reference image tensor |