docstr: Checks whether lasagne.updates handles float32 inputs correctly
docstr_tok: ["Checks","whether","lasagne.updates","handles","float32","inputs","correctly"]
code: def test_update_returntype(self, method, kwargs):
      """Checks whether lasagne.updates handles float32 inputs correctly"""
      floatX_ = theano.config.floatX
      theano.config.floatX = "float32"
      try:
          A = theano.shared(lasagne.utils.floatX([1, 1, 1]))
          B = theano.shared(lasagne.utils.floatX([1, 1, 1]))
          update_func = getattr(lasagne.updates, method)
          updates = update_func(self.f(A) + self.f(B), [A, B], **kwargs)
  
          assert all(v.dtype == "float32" for v in updates)
  
          # Checking for float32 arguments
          for param in kwargs:
              kwargs[param] = np.float32(kwargs[param])
          updates = update_func(self.f(A) + self.f(B), [A, B], **kwargs)
  
          assert all(v.dtype == "float32" for v in updates)
      finally:
          theano.config.floatX = floatX_
  
file_path: Lasagne/lasagne/tests/test_updates.py
imports: import pytest
  import numpy
  import theano
  import theano.tensor
  import lasagne
label_desc: Use image node_id 3 for calling the TestUpdateFunctions obj's underlying member method code with example usage: obj.test_update_returntype(method, kwargs) without return types