<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cache_values(self, results):
 		""" 		loads into DebugSession cache 		"""

		if results is None:
			# self.fn was probably only used to compute side effects.
			return
		elif isinstance(results,np.ndarray):
			# fn returns single np.ndarray.
			# re-format it into a list
			results=[results]
		# check validity of fn output
		elif isinstance(results,list):
			if len(results) is not len(self.outputs):
				raise ValueError('Number of output tensors does not match number of outputs produced by function')
		elif isinstance(results,np.number):
			if len(self.outputs) != 1:
				raise ValueError('Fn produces scalar but %d outputs expected' % (len(self.outputs)))
			results=[results]
		# assign each element in ndarrays to corresponding output tensor
		for i,ndarray in enumerate(results):
			self.session._cache_value(self.outputs[i], ndarray)