MCPcopy Create free account
hub / github.com/numpy/numpy / Ufunc

Class Ufunc

numpy/core/code_generators/generate_umath.py:188–219  ·  view source on GitHub ↗

Description of a ufunc. Attributes ---------- nin : number of input arguments nout : number of output arguments identity : identity element for a two-argument function (like Zero) docstring : docstring for the ufunc typereso: type resolver function of type PyUFunc_TypeRe

Source from the content-addressed store, hash-verified

186 return tds
187
188class Ufunc:
189 """Description of a ufunc.
190
191 Attributes
192 ----------
193 nin : number of input arguments
194 nout : number of output arguments
195 identity : identity element for a two-argument function (like Zero)
196 docstring : docstring for the ufunc
197 typereso: type resolver function of type PyUFunc_TypeResolutionFunc
198 type_descriptions : TypeDescription objects
199 signature: a generalized ufunc signature (like for matmul)
200 indexed: add indexed loops (ufunc.at) for these type characters
201 """
202 def __init__(self, nin, nout, identity, docstring, typereso,
203 *type_descriptions, signature=None, indexed=''):
204 self.nin = nin
205 self.nout = nout
206 if identity is None:
207 identity = None_
208 self.identity = identity
209 self.docstring = docstring
210 self.typereso = typereso
211 self.type_descriptions = []
212 self.signature = signature
213 self.indexed = indexed
214 for td in type_descriptions:
215 self.type_descriptions.extend(td)
216 for td in self.type_descriptions:
217 td.finish_signature(self.nin, self.nout)
218
219 check_td_order(self.type_descriptions)
220
221
222# String-handling utilities to avoid locale-dependence.

Callers 1

generate_umath.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected