November 2019
Intermediate to advanced
296 pages
7h 52m
English
Tensor destruction is important so that we can avoid resources being leaked from the tensor. As we mentioned previously, we can use the dispose method or tf.tidy to safely discard the resource that's allocated by the tensor. It is a neat way of managing memory for tensors. We should always make sure that we use them so that we can avoid any unexpected degradation that may occur in our application.
Unfortunately, variables are not deallocated by tf.tidy. Even if we write tf.variable inside the tf.tidy clause, the variable is not automatically cleaned up. There are two ways to dispose of variables in our application:
Since the variable is a subclass ...
Read now
Unlock full access