class_docstr: Records all computations done with a function in a file at output_path.
  Writes into the file the index of each apply node and sha256 digests of the
  numpy ndarrays it receives as inputs and produces as output.
  
  Example:
     # We use RecordMode to test that the computation of a function is
     identical. Create a Record object and use it to initialize a
     RecordMode object.
     output = cStringIO.StringIO()
     record = Record(file_object=output, replay=False)
     record_mode = RecordMode(record)
  
     # Then compile and call the function you wish to test, which uses
     # Apply nodes with record_mode as first parameter to record all the
     # computations to file. For example, call a Theano function with the
     # RecordMode object.
     x = theano.tensor.dscalar()
     f = theano.function([x], 2*x, mode=record_mode)
     print f(4)
  
     # Create another RecordMode object and initialize it with the previous
     # record.
     output = cStringIO.StringIO(output.getvalue())
     playback = Record(file_object=output, replay=True)
     playback_mode = RecordMode(playback)
  
     # Compile and call the function to test again with record_mode as
     # first parameter. An exception will be thrown if the recorded
     # computations are not identical between the two runs.
     x = theano.tensor.dscalar()
     f = theano.function([x], 2*x, mode=playback_mode)
     print f(4)
class_docstr_tok: ["Records","all","computations","done","with","a","function","in","a","file","at","output_path",".","Writes","into","the","file","the","index","of","each","apply","node","and","sha256","digests","of","the","numpy","ndarrays","it","receives","as","inputs","and","produces","as","output",".","Example",":","#","We","use","RecordMode","to","test","that","the","computation","of","a","function","is","identical",".","Create","a","Record","object","and","use","it","to","initialize","a","RecordMode","object",".","output","=","cStringIO.StringIO","(",")","record","=","Record","(","file_object=output",",","replay=False",")","record_mode","=","RecordMode","(","record",")","#","Then","compile","and","call","the","function","you","wish","to","test",",","which","uses","#","Apply","nodes","with","record_mode","as","first","parameter","to","record","all","the","#","computations","to","file",".","For","example",",","call","a","Theano","function","with","the","#","RecordMode","object",".","x","=","theano.tensor.dscalar","(",")","f","=","theano.function","(","[","x","]",",","2","*","x",",","mode=record_mode",")","print","f","(","4",")","#","Create","another","RecordMode","object","and","initialize","it","with","the","previous","#","record",".","output","=","cStringIO.StringIO","(","output.getvalue","(",")",")","playback","=","Record","(","file_object=output",",","replay=True",")","playback_mode","=","RecordMode","(","playback",")","#","Compile","and","call","the","function","to","test","again","with","record_mode","as","#","first","parameter",".","An","exception","will","be","thrown","if","the","recorded","#","computations","are","not","identical","between","the","two","runs",".","x","=","theano.tensor.dscalar","(",")","f","=","theano.function","(","[","x","]",",","2","*","x",",","mode=playback_mode",")","print","f","(","4",")"]
docstr: Configure object to use an existing Record object.
  
  Parameters
  ----------
  record : Record
      The Record object to use.
docstr_tok: ["Configure","object","to","use","an","existing","Record","object",".","Parameters","--","--","--","--","--","record",":","Record","The","Record","object","to","use","."]
code: def set_record(self, record):
      """
      Configure object to use an existing Record object.
  
      Parameters
      ----------
      record : Record
          The Record object to use.
      """
  
      self.record = record
      self.known_fgraphs = set([])
  
file_path: Theano/theano/tests/record.py
imports: from __future__ import absolute_import, print_function, division
  from theano.compile import Mode
  import theano
  from theano.printing import hex_digest
label_desc: Use image node_id 1 for calling the RecordMode obj's underlying member method code with example usage: obj.set_record(record) without return types