* making :term:`Apply` instances, which mean "apply this TOI to some particular inputs" (via the ``make_node``),
* performing the calculation of outputs from given inputs (via the ``perform``),
* producing c code to perform calculation of outputs from inputs (via ``c_code, c_code_cleanup, c_support_code, c_headers, c_libraries, c_compile_args``)
* producing c code to perform calculation of outputs from inputs (via ``c_code, c_code_cleanup, c_support_code, c_headers, c_libraries, c_compile_args, c_no_compile_args``)
* [optionally] building gradient-calculating graphs (via ``grad``).
# this is the param the -ffast-math activate. I put the explicitly as FillMissing must disable "-ffinite-math-only". Putting -ffast-math would make it disable all other parameter at the same time.
print"OPTIMISATION WARNING: in ConvOp.__init__() unroll_batch(%s) must be 0 or a multiple of bsize(%s). We revert it to 1. This won't change the result, but may make it slower."%(str(self.unroll_batch),str(self.bsize))
self.unroll_batch=1
ifself.unroll_kern>0andself.nkern%unroll_kern!=0:
ifself.nkern<self.unroll_kern:
ifself.nkern<=self.unroll_kern:
self.unroll_kern=self.nkern
else:
self.unroll_kern=1
print"OPTIMISATION WARNING: in ConvOp.__init__() unroll_kern(%s) should be 0 or a multiple of nkern(%s)We revert it to 1. This won't change the result, but may make it slower."%(str(self.unroll_kern),str(self.nkern))
ifself.dx!=1orself.dy!=1:
print"Warning, dx!=1 or dy!=1 only supported in python mode!"
raiseNotImplementedError('Only [full,valid] modes are currently supported.')
filters=filters[:,:,::-1,::-1]
#find good value for the unroll
un_b=self.unroll_batch
un_k=self.unroll_kern
ifun_b!=0andbsize%un_b!=0:
ifbsize<un_b:
un_b=bsize
else:
un_b=1
print"OPTIMISATION WARNING: in ConvOp.grad() we can't determine a good unroll value for the batch. Maybe you can optimize this!"
print"OPTIMISATION WARNING: in ConvOp.grad() we can't determine a good unroll value for the batch. Maybe you can optimize this!",bsize,un_b,self.unroll_batch,self.unroll_kern