class_docstr: Cache values based on a key object (such as a sphere or gradient table).
  
  Notes
  -----
  This class is meant to be used as a mix-in::
  
      class MyModel(Model, Cache):
          pass
  
      class MyModelFit(Fit):
          pass
  
  Inside a method on the fit, typical usage would be::
  
      def odf(sphere):
          M = self.model.cache_get('odf_basis_matrix', key=sphere)
  
          if M is None:
              M = self._compute_basis_matrix(sphere)
              self.model.cache_set('odf_basis_matrix', key=sphere, value=M)
class_docstr_tok: ["Cache","values","based","on","a","key","object","(","such","as","a","sphere","or","gradient","table",")",".","Notes","--","--","-","This","class","is","meant","to","be","used","as","a","mix-in",":",":","class","MyModel","(","Model",",","Cache",")",":","pass","class","MyModelFit","(","Fit",")",":","pass","Inside","a","method","on","the","fit",",","typical","usage","would","be",":",":","def","odf","(","sphere",")",":","M","=","self.model.cache_get","(","'odf_basis_matrix","'",",","key=sphere",")","if","M","is","None",":","M","=","self._compute_basis_matrix","(","sphere",")","self.model.cache_set","(","'odf_basis_matrix","'",",","key=sphere",",","value=M",")"]
docstr: Clear the cache.
  
          
docstr_tok: ["Clear","the","cache","."]
code: def cache_clear(self):
      """Clear the cache."""
      self._cache = {}
  
imports: from dipy.core.onetime import auto_attr
label_desc: Use image node_id 4 for calling the Cache obj's underlying member method code with example usage: obj.cache_clear() without return types