b5e847a5bf5f38ef30ebb2328c4d58ea28aa464a,qiskit_aqua/utils/circuit_cache.py,CircuitCache,cache_circuit,#CircuitCache#Any#Any#Any#,61

Before Change


            qobj_dicts = [qobj_to_dict(qob) for qob in self.qobjs]
            pickle.dump({"qobjs":qobj_dicts, "mappings":self.mappings}, cache_handler, protocol=pickle.HIGHEST_PROTOCOL)
            cache_handler.close()
            logger.debug("Circuit cache saved to file.")

    def try_loading_cache_from_file(self):
        if len(self.qobjs) == 0 and self.cache_file is not None and len(self.cache_file) > 0:
            cache_handler = open(self.cache_file, "rb")

After Change


                    op_graph.get(type_and_qubits, []) + [i]
            mapping = []
            for compiled_gate_index, compiled_gate in enumerate(qobj.experiments[circ_num].instructions):
                if not hasattr(compiled_gate, "params"): continue
                type_and_qubits = compiled_gate.name + compiled_gate.qubits.__str__()
                if len(op_graph[type_and_qubits]) > 0:
                    uncompiled_gate_index = op_graph[type_and_qubits].pop(0)
                    uncompiled_gate = raw_gates[uncompiled_gate_index]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: b5e847a5bf5f38ef30ebb2328c4d58ea28aa464a
Time: 2019-01-03
Author: dongreenberg2@gmail.com
File Name: qiskit_aqua/utils/circuit_cache.py
Class Name: CircuitCache
Method Name: cache_circuit


Project Name: kengz/SLM-Lab
Commit Name: 0ac2b33e8c63304a50db7d2b484368299706b58b
Time: 2018-11-14
Author: kengzwl@gmail.com
File Name: slm_lab/agent/net/mlp.py
Class Name: MLPNet
Method Name: training_step


Project Name: kengz/SLM-Lab
Commit Name: 0ac2b33e8c63304a50db7d2b484368299706b58b
Time: 2018-11-14
Author: kengzwl@gmail.com
File Name: slm_lab/agent/net/recurrent.py
Class Name: RecurrentNet
Method Name: training_step