sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Jan 9 13:16:08 2021 | |
@author: danish | |
""" | |
# OpenCV Python script to buffer the video stream |
refer to: https://stackoverflow.com/questions/39371772/how-to-install-anaconda-on-raspberry-pi-3-model-b
{USER}: pi
Install Miniconda 3:
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh # (optional) check md5
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh
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
a = tf.Variable(0) | |
@tf.function | |
def g(x): | |
x.assign_add(1) | |
return x | |
print(g(a)) | |
print(g(a)) | |
print(g(a)) |
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
@tf.function | |
def f(b): | |
a = tf.constant([[10,10],[11.,1.]]) | |
x = tf.constant([[1.,0.],[0.,1.]]) | |
y = tf.matmul(a, x) + b | |
print("PRINT: ", y) | |
tf.print("TF-PRINT: ", y) | |
return y | |
b = tf.Variable(12.) |
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
class F(): | |
def __init__(self): | |
self._b = None | |
@tf.function | |
def __call__(self): | |
a = tf.constant([[10, 10], [11., 1.]]) | |
x = tf.constant([[1., 0.], [0., 1.]]) | |
if self._b is None: | |
self._b = tf.Variable(12.) |
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
b = None | |
@tf.function | |
def f(): | |
a = tf.constant([[10, 10], [11., 1.]]) | |
x = tf.constant([[1., 0.], [0., 1.]]) | |
global b | |
if b is None: | |
b = tf.Variable(12.) | |
y = tf.matmul(a, x) + b |
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
@tf.function | |
def f(): | |
a = tf.constant([[10,10],[11.,1.]]) | |
x = tf.constant([[1.,0.],[0.,1.]]) | |
b = tf.Variable(12.) | |
y = tf.matmul(a, x) + b | |
print("PRINT: ", y) | |
tf.print("TF-PRINT: ", y) | |
return y |
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 f(): | |
a = tf.constant([[10,10],[11.,1.]]) | |
x = tf.constant([[1.,0.],[0.,1.]]) | |
b = tf.Variable(12.) | |
y = tf.matmul(a, x) + b | |
return y |
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
a = tf.constant([[10,10],[11.,1.]]) | |
x = tf.constant([[1.,0.],[0.,1.]]) | |
b = tf.Variable(12.) | |
y = tf.matmul(a, x) + b | |
print(y.numpy()) |
NewerOlder