INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Walks the _evaluated_ tree of the given GCL tuple. | def walk(value, walker, path=None, seen=None):
"""Walks the _evaluated_ tree of the given GCL tuple.
The appropriate methods of walker will be invoked for every element in the
tree.
"""
seen = seen or set()
path = path or []
# Recursion
if id(value) in seen:
walker.visitRecursion(path)
return
... |
Return a hash value that uniquely identifies the GCL value. | def fingerprint(value):
"""Return a hash value that uniquely identifies the GCL value."""
h = hashlib.sha256()
_digest(value, h)
return h.digest().encode('hex') |
Return the the last 2 error messages from an error stack. | def compact_error(err):
"""Return the the last 2 error messages from an error stack.
These error messages turns out to be the most descriptive.
"""
def err2(e):
if isinstance(e, exceptions.EvaluationError) and e.inner:
message, i = err2(e.inner)
if i == 1:
return ', '.join([e.args[0], s... |
Backpropagate through the logistic layer. | def backprop(self, input_data, targets,
cache=None):
""" Backpropagate through the logistic layer.
**Parameters:**
input_data : ``GPUArray``
Inpute data to compute activations for.
targets : ``GPUArray``
The target values of the units.
... |
Return the cross entropy error | def cross_entropy_error(self, input_data, targets, average=True,
cache=None, prediction=False):
""" Return the cross entropy error
"""
if cache is not None:
activations = cache
else:
activations = \
self.feed_forward(inpu... |
Parse comment lines and make subsequent indented lines into a code block block. | def stylize_comment_block(lines):
"""Parse comment lines and make subsequent indented lines into a code block
block.
"""
normal, sep, in_code = range(3)
state = normal
for line in lines:
indented = line.startswith(' ')
empty_line = line.strip() == ''
if state == normal and empty_line:
... |
Return two pairs of members scalar and tuple members. | def sort_members(tup, names):
"""Return two pairs of members, scalar and tuple members.
The scalars will be sorted s.t. the unbound members are at the top.
"""
scalars, tuples = partition(lambda x: not is_tuple_node(tup.member[x].value), names)
unbound, bound = partition(lambda x: tup.member[x].value.is_unbo... |
Resolve filename relatively against one of the given paths if possible. | def resolve_file(fname, paths):
"""Resolve filename relatively against one of the given paths, if possible."""
fpath = path.abspath(fname)
for p in paths:
spath = path.abspath(p)
if fpath.startswith(spath):
return fpath[len(spath) + 1:]
return fname |
Generate a list of strings representing the table in RST format. | def generate(self):
"""Generate a list of strings representing the table in RST format."""
header = ' '.join('=' * self.width[i] for i in range(self.w))
lines = [
' '.join(row[i].ljust(self.width[i]) for i in range(self.w))
for row in self.rows]
return [header] + lines + [header] |
Use a predicate to partition entries into false entries and true entries | def partition(pred, iterable):
'Use a predicate to partition entries into false entries and true entries'
# partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9
t1, t2 = itertools.tee(iterable)
return list(filter(negate(pred), t1)), list(filter(pred, t2)) |
Select nodes according to the input selector. | def select(self, model):
"""Select nodes according to the input selector.
This can ALWAYS return multiple root elements.
"""
res = []
def doSelect(value, pre, remaining):
if not remaining:
res.append((pre, value))
else:
# For the other selectors to work, value must be a... |
Return a deep dict of the values selected. | def deep(self):
"""Return a deep dict of the values selected.
The leaf values may still be gcl Tuples. Use util.to_python() if you want
to reify everything to real Python values.
"""
self.lists = {}
ret = {}
for path, value in self.paths_values():
self.recursiveSet(ret, path, value)
... |
List/ dictionary - aware set. | def ldSet(self, what, key, value):
"""List/dictionary-aware set."""
if isListKey(key):
# Make sure we keep the indexes consistent, insert missing_values
# as necessary. We do remember the lists, so that we can remove
# missing values after inserting all values from all selectors.
self.li... |
List - aware get. | def ldGet(self, what, key):
"""List-aware get."""
if isListKey(key):
return what[listKeyIndex(key)]
else:
return what[key] |
List/ dictinary/ missing - aware contains. | def ldContains(self, what, key):
"""List/dictinary/missing-aware contains.
If the value is a "missing_value", we'll treat it as non-existent
so it will be overwritten by an empty list/dict when necessary to
assign child keys.
"""
if isListKey(key):
i = listKeyIndex(key)
return i < l... |
Return a list of nodes that have a recursive dependency. | def find_recursive_dependency(self):
"""Return a list of nodes that have a recursive dependency."""
nodes_on_path = []
def helper(nodes):
for node in nodes:
cycle = node in nodes_on_path
nodes_on_path.append(node)
if cycle or helper(self.deps.get(node, [])):
return T... |
Called for every tuple. | def enterTuple(self, tuple, path):
"""Called for every tuple.
If this returns False, the elements of the tuple will not be recursed over
and leaveTuple() will not be called.
"""
if skip_name(path):
return False
node = Node(path, tuple)
if self.condition.matches(node):
self.unord... |
Convert with location. | def convertAndMake(converter, handler):
"""Convert with location."""
def convertAction(loc, value):
return handler(loc, converter(value))
return convertAction |
Make a sequence of applications from a list of tokens. | def mkApplications(location, *atoms):
"""Make a sequence of applications from a list of tokens.
atoms is a list of atoms, which will be handled left-associatively. E.g:
['foo', [], []] == foo()() ==> Application(Application('foo', []), [])
"""
atoms = list(atoms)
while len(atoms) > 1:
atoms[0:2] =... |
Call a function respecting all the various types of functions that exist. | def call_fn(fn, arglist, env):
"""Call a function, respecting all the various types of functions that exist."""
if isinstance(fn, framework.LazyFunction):
# The following looks complicated, but this is necessary because you can't
# construct closures over the loop variable directly.
thunks = [(lambda th... |
Return the schema spec from a run - time tuple. | def schema_spec_from_tuple(tup):
"""Return the schema spec from a run-time tuple."""
if hasattr(tup, 'get_schema_spec'):
# Tuples have a TupleSchema field that contains a model of the schema
return schema.from_spec({
'fields': TupleSchemaAccess(tup),
'required': tup.get_required_fields()})
... |
Make a Schema object from the given spec. | def make_schema_from(value, env):
"""Make a Schema object from the given spec.
The input and output types of this function are super unclear, and are held together by ponies,
wishes, duct tape, and a load of tests. See the comments for horrific entertainment.
"""
# So this thing may not need to evaluate any... |
Parse bracketed list. | def bracketedList(l, r, sep, expr, allow_missing_close=False):
"""Parse bracketed list.
Empty list is possible, as is a trailing separator.
"""
# We may need to backtrack for lists, because of list comprehension, but not for
# any of the other lists
strict = l != '['
closer = sym(r) if not allow_missing_... |
Unquote the indicated string. | def unquote(s):
"""Unquote the indicated string."""
# Ignore the left- and rightmost chars (which should be quotes).
# Use the Python engine to decode the escape sequence
i, N = 1, len(s) - 1
ret = []
while i < N:
if s[i] == '\\' and i < N - 1:
ret.append(UNQUOTE_MAP.get(s[i+1], s[i+1]))
i +... |
Function to put a name on a pyparsing pattern. | def pattern(name, pattern):
"""Function to put a name on a pyparsing pattern.
Just for ease of debugging/tracing parse errors.
"""
pattern.setName(name)
astracing.maybe_trace(pattern)
return pattern |
Make the part of the grammar that depends on whether we swallow errors or not. | def make_grammar(allow_errors):
"""Make the part of the grammar that depends on whether we swallow errors or not."""
if allow_errors in GRAMMAR_CACHE:
return GRAMMAR_CACHE[allow_errors]
tuple = p.Forward()
catch_errors = p.Forward()
catch_errors << (p.Regex('[^{};]*') - p.Optional(tuple) - p.Regex('[^;}]... |
Load but don t evaluate a GCL expression from a string. | def reads(s, filename, loader, implicit_tuple, allow_errors):
"""Load but don't evaluate a GCL expression from a string."""
try:
the_context.filename = filename
the_context.loader = loader
grammar = make_grammar(allow_errors=allow_errors)
root = grammar.start_tuple if implicit_tuple else grammar.st... |
Find all AST nodes at the given filename line and column. | def find_tokens(self, q):
"""Find all AST nodes at the given filename, line and column."""
found_me = []
if hasattr(self, 'location'):
if self.location.contains(q):
found_me = [self]
elif self._found_by(q):
found_me = [self]
cs = [n.find_tokens(q) for n in self._children()]
... |
Instantiate the Tuple based on this TupleNode. | def _make_tuple(self, env):
"""Instantiate the Tuple based on this TupleNode."""
t = runtime.Tuple(self, env, dict2tuple)
# A tuple also provides its own schema spec
schema = schema_spec_from_tuple(t)
t.attach_schema(schema)
return t |
Apply a tuple to something else. | def applyTuple(self, tuple, right, env):
"""Apply a tuple to something else."""
if len(right) != 1:
raise exceptions.EvaluationError('Tuple (%r) can only be applied to one argument, got %r' % (self.left, self.right))
right = right[0]
return tuple(right) |
Apply a list to something else. | def applyIndex(self, lst, right):
"""Apply a list to something else."""
if len(right) != 1:
raise exceptions.EvaluationError('%r can only be applied to one argument, got %r' % (self.left, self.right))
right = right[0]
if isinstance(right, int):
return lst[right]
raise exceptions.Evalua... |
First step of Nesterov momentum method: take step in direction of accumulated gradient | def pre_gradient_update(self):
""" First step of Nesterov momentum method:
take step in direction of accumulated gradient
"""
updates = zip(self.velocity, self.model.n_parameters * [1.])
self.model.update_parameters(updates) |
Return the classification error rate | def class_error(self, input_data, targets, average=True,
cache=None, prediction=False):
""" Return the classification error rate
"""
if cache is not None:
activations = cache
else:
activations = \
self.feed_forward(input_data, pr... |
The KL divergence error | def kl_error(self, input_data, targets, average=True,
cache=None, prediction=True):
""" The KL divergence error
"""
if cache is not None:
activations = cache
else:
activations = \
self.feed_forward(input_data, prediction=prediction)... |
Dot product of two arrays. | def dot(x_gpu, y_gpu, transa='N', transb='N', handle=None, target=None):
"""
Dot product of two arrays.
For 1D arrays, this function computes the inner product. For 2D
arrays of shapes `(m, k)` and `(k, n)`, it computes the matrix
product; the result has shape `(m, n)`.
Parameters
--------... |
Create a temp file write our PID into it. | def make_tempfile(data=None):
"Create a temp file, write our PID into it."
with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp:
temp.write(six.text_type(data if data is not None else os.getpid()))
return temp.name |
Return a list where each element contains the parameters for a task. | def parameters(self):
"""Return a list where each element contains the parameters for a task.
"""
parameters = []
for task in self.tasks:
parameters.extend(task.parameters)
return parameters |
Update the parameters. | def parameters(self, value):
"""Update the parameters.
``value`` must be a list/tuple of length
``MultitaskTopLayer.n_tasks``, each element of which must have
the correct number of parameters for the task.
"""
assert len(value) == self.n_parameters
i = 0
... |
Call feed_forward for each task and combine the activations. | def feed_forward(self, input_data, prediction=False):
"""Call ``feed_forward`` for each task and combine the activations.
Passes ``input_data`` to all tasks and returns the activations
as a list.
**Parameters:**
input_data : ``GPUArray``
Inpute data to compute ... |
Compute gradients for each task and combine the results. | def backprop(self, input_data, targets, cache=None):
"""Compute gradients for each task and combine the results.
**Parameters:**
input_data : ``GPUArray``
Inpute data to compute activations for.
targets : ``GPUArray``
The target values of the units.
ca... |
Computes the cross - entropy error for all tasks. | def cross_entropy_error(self, input_data, targets, average=True,
cache=None, prediction=False,
sum_errors=True):
""" Computes the cross-entropy error for all tasks.
"""
loss = []
if cache is None:
cache = self.n_tasks *... |
Update the parameters. value must have the shape ( weights biases ) | def parameters(self, value):
"""Update the parameters. ``value`` must have the shape
``(weights, biases)``"""
self.W = value[0] if isinstance(value[0], GPUArray) else \
gpuarray.to_gpu(value[0])
self.b = value[1] if isinstance(value[0], GPUArray) else \
gpuarray.to_gp... |
Returns a dictionary describing the architecture of the layer. | def architecture(self):
"""Returns a dictionary describing the architecture of the layer."""
arch = {'class': self.__class__,
'n_in': self.n_in,
'n_units': self.n_units,
'activation_function': self.activation_function
if hasattr(self, 'acti... |
Propagate forward through the layer | def feed_forward(self, input_data, prediction=False):
"""Propagate forward through the layer
**Parameters:**
input_data : ``GPUArray``
Input data to compute activations for.
prediction : bool, optional
Whether to use prediction model. Only relevant when using
... |
Backpropagate through the hidden layer | def backprop(self, input_data, df_output, cache=None):
""" Backpropagate through the hidden layer
**Parameters:**
input_data : ``GPUArray``
Input data to compute activations for.
df_output : ``GPUArray``
Gradients with respect to the activations of this layer
... |
Initialize CUBLAS. | def cublasCreate():
"""
Initialize CUBLAS.
Initializes CUBLAS and creates a handle to a structure holding
the CUBLAS library context.
Returns
-------
handle : void_p
CUBLAS context.
"""
handle = ctypes.c_void_p()
status = _libcublas.cublasCreate_v2(ctypes.... |
Release CUBLAS resources. | def cublasDestroy(handle):
"""
Release CUBLAS resources.
Releases hardware resources used by CUBLAS.
Parameters
----------
handle : void_p
CUBLAS context.
"""
status = _libcublas.cublasDestroy_v2(ctypes.c_void_p(handle))
cublasCheckStatus(status) |
Get CUBLAS version. | def cublasGetVersion(handle):
"""
Get CUBLAS version.
Returns version number of installed CUBLAS libraries.
Parameters
----------
handle : void_p
CUBLAS context.
Returns
-------
version : int
CUBLAS version.
"""
version = ctypes.c_int()
status = _... |
Set current CUBLAS library stream. Parameters ---------- handle: id CUBLAS context. id: int Stream ID. | def cublasSetStream(handle, id):
"""
Set current CUBLAS library stream.
Parameters
----------
handle : id
CUBLAS context.
id : int
Stream ID.
"""
status = _libcublas.cublasSetStream_v2(handle, id)
cublasCheckStatus(status) |
Set current CUBLAS library stream. | def cublasGetStream(handle):
"""
Set current CUBLAS library stream.
Parameters
----------
handle : void_p
CUBLAS context.
Returns
-------
id : int
Stream ID.
"""
id = ctypes.c_int()
status = _libcublas.cublasGetStream_v2(handle, ctypes.byref(id))
... |
Matrix - vector product for real general banded matrix. | def cublasSgbmv(handle, trans, m, n, kl, ku, alpha, A, lda,
x, incx, beta, y, incy):
"""
Matrix-vector product for real general banded matrix.
"""
status = _libcublas.cublasSgbmv_v2(handle,
trans, m, n, kl, ku,
... |
Matrix - vector product for complex general banded matrix. | def cublasCgbmv(handle, trans, m, n, kl, ku, alpha, A, lda,
x, incx, beta, y, incy):
"""
Matrix-vector product for complex general banded matrix.
"""
status = _libcublas.cublasCgbmv_v2(handle,
trans, m, n, kl, ku,
... |
Matrix - vector product for complex general banded matrix. | def cublasZgbmv(handle, trans, m, n, kl, ku, alpha, A, lda,
x, incx, beta, y, incy):
"""
Matrix-vector product for complex general banded matrix.
"""
status = _libcublas.cublasZgbmv_v2(handle,
trans, m, n, kl, ku,
... |
Matrix - vector product for real general matrix. | def cublasSgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real general matrix.
"""
status = _libcublas.cublasSgemv_v2(handle,
_CUBLAS_OP[trans], m, n,
ctypes.byref(ctypes.c_fl... |
Matrix - vector product for real general matrix. | def cublasDgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real general matrix.
"""
status = _libcublas.cublasDgemv_v2(handle,
_CUBLAS_OP[trans], m, n,
ctypes.byref(ctypes.c_do... |
Matrix - vector product for complex general matrix. | def cublasCgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for complex general matrix.
"""
status = _libcublas.cublasCgemv_v2(handle,
_CUBLAS_OP[trans], m, n,
ctypes.byref(cuda.cuF... |
Matrix - vector product for complex general matrix. | def cublasZgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for complex general matrix.
"""
status = _libcublas.cublasZgemv_v2(handle,
_CUBLAS_OP[trans], m, n,
ctypes.byref(cuda.cuD... |
Rank - 1 operation on real general matrix. | def cublasSger(handle, m, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-1 operation on real general matrix.
"""
status = _libcublas.cublasSger_v2(handle,
m, n,
ctypes.byref(ctypes.c_float(alpha)),
... |
Rank - 1 operation on real general matrix. | def cublasDger(handle, m, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-1 operation on real general matrix.
"""
status = _libcublas.cublasDger_v2(handle,
m, n,
ctypes.byref(ctypes.c_double(alpha)),
... |
Rank - 1 operation on complex general matrix. | def cublasCgeru(handle, m, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-1 operation on complex general matrix.
"""
status = _libcublas.cublasCgeru_v2(handle,
m, n, ctypes.byref(cuda.cuFloatComplex(alpha.real,
... |
Rank - 1 operation on complex general matrix. | def cublasZgerc(handle, m, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-1 operation on complex general matrix.
"""
status = _libcublas.cublasZgerc_v2(handle,
m, n, ctypes.byref(cuda.cuDoubleComplex(alpha.real,
... |
Matrix - vector product for real symmetric - banded matrix. | def cublasSsbmv(handle, uplo, n, k, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric-banded matrix.
"""
status = _libcublas.cublasSsbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n, k,
ctypes.byr... |
Matrix - vector product for real symmetric - banded matrix. | def cublasDsbmv(handle, uplo, n, k, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric-banded matrix.
"""
status = _libcublas.cublasDsbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n, k,
ctypes.byr... |
Matrix - vector product for real symmetric - packed matrix. | def cublasSspmv(handle, uplo, n, alpha, AP, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric-packed matrix.
"""
status = _libcublas.cublasSspmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n,
... |
Matrix - vector product for real symmetric - packed matrix. | def cublasDspmv(handle, uplo, n, alpha, AP, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric-packed matrix.
"""
status = _libcublas.cublasDspmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n,
... |
Rank - 1 operation on real symmetric - packed matrix. | def cublasSspr(handle, uplo, n, alpha, x, incx, AP):
"""
Rank-1 operation on real symmetric-packed matrix.
"""
status = _libcublas.cublasSspr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
c... |
Rank - 1 operation on real symmetric - packed matrix. | def cublasDspr(handle, uplo, n, alpha, x, incx, AP):
"""
Rank-1 operation on real symmetric-packed matrix.
"""
status = _libcublas.cublasDspr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctype... |
Rank - 2 operation on real symmetric - packed matrix. | def cublasSspr2(handle, uplo, n, alpha, x, incx, y, incy, AP):
"""
Rank-2 operation on real symmetric-packed matrix.
"""
status = _libcublas.cublasSspr2_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_float(al... |
Rank - 2 operation on real symmetric - packed matrix. | def cublasDspr2(handle, uplo, n, alpha, x, incx, y, incy, AP):
"""
Rank-2 operation on real symmetric-packed matrix.
"""
status = _libcublas.cublasDspr2_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_double(a... |
Matrix - vector product for real symmetric matrix. | def cublasSsymv(handle, uplo, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric matrix.
"""
status = _libcublas.cublasSsymv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(... |
Matrix - vector product for real symmetric matrix. | def cublasDsymv(handle, uplo, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric matrix.
"""
status = _libcublas.cublasDsymv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctyp... |
Matrix - vector product for complex symmetric matrix. | def cublasCsymv(handle, uplo, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for complex symmetric matrix.
"""
status = _libcublas.cublasCsymv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(cud... |
Matrix - vector product for complex symmetric matrix. | def cublasZsymv(handle, uplo, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for complex symmetric matrix.
"""
status = _libcublas.cublasZsymv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(cud... |
Rank - 1 operation on real symmetric matrix. | def cublasSsyr(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on real symmetric matrix.
"""
status = _libcublas.cublasSsyr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_float(alpha)),
... |
Rank - 1 operation on real symmetric matrix. | def cublasDsyr(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on real symmetric matrix.
"""
status = _libcublas.cublasDsyr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_double(alpha)),
... |
Rank - 1 operation on complex symmetric matrix. | def cublasCsyr(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on complex symmetric matrix.
"""
status = _libcublas.cublasCsyr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(cuda.cuFloatComplex(alpha.r... |
Rank - 1 operation on complex symmetric matrix. | def cublasZsyr(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on complex symmetric matrix.
"""
status = _libcublas.cublasZsyr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(cuda.cuDoubleComplex(alpha.... |
Rank - 2 operation on real symmetric matrix. | def cublasSsyr2(handle, uplo, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-2 operation on real symmetric matrix.
"""
status = _libcublas.cublasSsyr2_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_float(alpha)... |
Rank - 2 operation on real symmetric matrix. | def cublasDsyr2(handle, uplo, n, alpha, x, incx, y, incy, A, lda):
"""
Rank-2 operation on real symmetric matrix.
"""
status = _libcublas.cublasDsyr2_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_double(alph... |
Matrix - vector product for real triangular - banded matrix. | def cublasStbmv(handle, uplo, trans, diag, n, k, A, lda, x, incx):
"""
Matrix-vector product for real triangular-banded matrix.
"""
status = _libcublas.cublasStbmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],... |
Matrix - vector product for real triangular - packed matrix. | def cublasStpmv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Matrix-vector product for real triangular-packed matrix.
"""
status = _libcublas.cublasStpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Matrix - vector product for complex triangular - packed matrix. | def cublasCtpmv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Matrix-vector product for complex triangular-packed matrix.
"""
status = _libcublas.cublasCtpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Matrix - vector product for real triangular - packed matrix. | def cublasDtpmv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Matrix-vector product for real triangular-packed matrix.
"""
status = _libcublas.cublasDtpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Matrix - vector product for complex triangular - packed matrix. | def cublasZtpmv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Matrix-vector product for complex triangular-packed matrix.
"""
status = _libcublas.cublasZtpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Solve real triangular - packed system with one right - hand side. | def cublasStpsv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Solve real triangular-packed system with one right-hand side.
"""
status = _libcublas.cublasStpsv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Solve real triangular - packed system with one right - hand side. | def cublasDtpsv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Solve real triangular-packed system with one right-hand side.
"""
status = _libcublas.cublasDtpsv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Solve complex triangular - packed system with one right - hand side. | def cublasCtpsv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Solve complex triangular-packed system with one right-hand side.
"""
status = _libcublas.cublasCtpsv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[tra... |
Solve complex triangular - packed system with one right - hand size. | def cublasZtpsv(handle, uplo, trans, diag, n, AP, x, incx):
"""
Solve complex triangular-packed system with one right-hand size.
"""
status = _libcublas.cublasZtpsv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans]... |
Matrix - vector product for complex triangular matrix. | def cublasCtrmv(handle, uplo, trans, diag, n, A, lda, x, incx):
"""
Matrix-vector product for complex triangular matrix.
"""
status = _libcublas.cublasCtrmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Matrix - vector product for real triangular matrix. | def cublasDtrmv(handle, uplo, trans, diag, n, A, lda, x, inx):
"""
Matrix-vector product for real triangular matrix.
"""
status = _libcublas.cublasDtrmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... |
Matrix - vector product for Hermitian - packed matrix. | def cublasChpmv(handle, uplo, n, alpha, AP, x, incx, beta, y, incy):
"""
Matrix-vector product for Hermitian-packed matrix.
"""
status = _libcublas.cublasChpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(cuda.c... |
Matrix - vector product for Hermitian - packed matrix. | def cublasZhpmv(handle, uplo, n, alpha, AP, x, incx, beta, y, incy):
"""
Matrix-vector product for Hermitian-packed matrix.
"""
status = _libcublas.cublasZhpmv_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(cuda.cu... |
Rank - 1 operation on Hermitian matrix. | def cublasCher(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on Hermitian matrix.
"""
status = _libcublas.cublasCher_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, alpha, int(x), incx, int(A), lda)
cublasCheckSt... |
Rank - 1 operation on Hermitian matrix. | def cublasZher(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on Hermitian matrix.
"""
status = _libcublas.cublasZher_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, alpha, int(x), incx, int(A), lda)
cublasChe... |
Rank - 1 operation on Hermitian - packed matrix. | def cublasChpr(handle, uplo, n, alpha, x, incx, AP):
"""
Rank-1 operation on Hermitian-packed matrix.
"""
status = _libcublas.cublasChpr_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(ctypes.c_float(alpha)),
... |
Rank - 1 operation on Hermitian - packed matrix. | def cublasZhpr(handle, uplo, n, alpha, x, incx, AP):
"""
Rank-1 operation on Hermitian-packed matrix.
"""
status = _libcublas.cublasZhpr_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(ctypes.c_double(alpha)),
... |
Rank - 2 operation on Hermitian - packed matrix. | def cublasChpr2(handle, uplo, n, alpha, x, inx, y, incy, AP):
"""
Rank-2 operation on Hermitian-packed matrix.
"""
status = _libcublas.cublasChpr2_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(cuda.cuFloatComplex... |
Rank - 2 operation on Hermitian - packed matrix. | def cublasZhpr2(handle, uplo, n, alpha, x, inx, y, incy, AP):
"""
Rank-2 operation on Hermitian-packed matrix.
"""
status = _libcublas.cublasZhpr2_v2(handle,
_CUBLAS_FILL_MODE[uplo],
n, ctypes.byref(cuda.cuDoubleComple... |
Matrix - matrix product for real general matrix. | def cublasSgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for real general matrix.
"""
status = _libcublas.cublasSgemm_v2(handle,
_CUBLAS_OP[transa],
_CUBLAS_OP[transb],... |
Matrix - matrix product for real general matrix. | def cublasDgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for real general matrix.
"""
status = _libcublas.cublasDgemm_v2(handle,
_CUBLAS_OP[transa],
_CUBLAS_OP[transb],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.