The purpose of this tutorial is to use the google TPU device together with Keras.
You need to set from the Edit menu and set for the notebook the device called TPU.
You can find the source code on my GitHub account here.
Is a blog about python programming language. You can see my work with python programming language, tutorials and news.
[mythcat@desk ~]$ python3.9
Python 3.9.5 (default, May 4 2021, 00:00:00)
[GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from abc import ABC
>>> class Test_ABC(ABC):
... pass
...
>>> Test_ABC.register(tuple)
>>> assert issubclass(tuple,Test_ABC)
>>> assert isinstance((), Test_ABC)
>>> class Foo:
... def __getitem__(self, index):
... ...
... def __len__(self):
... ...
... def get_iterator(self):
... return iter(self)
...
>>> Test_ABC.register(Foo)
...
from abc import ABC, abstractmethod
class Vehicle(ABC):
@abstractmethod
def action(self):
pass
class Air(Vehicle):
# overriding abstract method
def action(self):
print("this flies in the air")
class Ground(Vehicle):
# overriding abstract method
def action(self):
print("this running on the field")
class Civil(Ground):
def action(self):
print("Civil class - running on the field")
# Can't instantiate abstract class with abstract method action, don't use it
# abc = Vehicle()
abc = Air()
abc.action()
abc = Ground()
abc.action()
abc = Civil()
abc.action()
print( issubclass(Civil, Vehicle))
print( isinstance(Civil(), Vehicle))
[mythcat@desk PythonProjects]$ python3.9 ABC_001.py
this flies in the air
this running on the field
Civil class - running on the field
True
True