Exemplo n.º 1
0
 def result(inp):
     dtype = inp.dtype
     ctx_name = _name_for_ctx(inp.context)
     key = (dtype, ctx_name)
     f = result.cache.get(key, None)
     if f is None:
         guard_in = GpuArrayType(str(dtype), (False,), context_name=ctx_name)()
         mode = get_mode("FAST_RUN").including("gpuarray")
         f = theano.function([guard_in], op(guard_in), mode=mode, profile=False)
         result.cache[key] = f
     return f(inp)
Exemplo n.º 2
0
 def result(inp):
     dtype = inp.dtype
     ctx_name = _name_for_ctx(inp.context)
     key = (dtype, ctx_name)
     f = result.cache.get(key, None)
     if f is None:
         guard_in = GpuArrayType(str(dtype), (False,), context_name=ctx_name)()
         mode = get_mode("FAST_RUN").including("gpuarray")
         f = theano.function([guard_in], op(guard_in), mode=mode, profile=False)
         result.cache[key] = f
     return f(inp)
Exemplo n.º 3
0
 def write_array(f):
     pickle.dump(_name_for_ctx(obj.context), f, 2)
     np.lib.format.write_array(f, np.asarray(obj))
Exemplo n.º 4
0
 def write_array(f):
     pickle.dump(_name_for_ctx(obj.context), f, 2)
     np.lib.format.write_array(f, np.asarray(obj))