sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
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 real general matrix. | entailment |
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. | entailment |
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... | Matrix-vector product for complex general matrix. | entailment |
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. | entailment |
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 real general matrix. | entailment |
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. | entailment |
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,
... | Rank-1 operation on complex general matrix. | entailment |
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. | entailment |
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-banded matrix. | entailment |
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. | entailment |
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,
... | Matrix-vector product for real symmetric-packed matrix. | entailment |
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. | entailment |
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-1 operation on real symmetric-packed matrix. | entailment |
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. | entailment |
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... | Rank-2 operation on real symmetric-packed matrix. | entailment |
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. | entailment |
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 real symmetric matrix. | entailment |
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. | entailment |
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... | Matrix-vector product for complex symmetric matrix. | entailment |
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. | entailment |
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 real symmetric matrix. | entailment |
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. | entailment |
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-1 operation on complex symmetric matrix. | entailment |
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. | entailment |
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... | Rank-2 operation on real symmetric matrix. | entailment |
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-banded matrix. | entailment |
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 real triangular-packed matrix. | entailment |
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 complex triangular-packed matrix. | entailment |
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 real triangular-packed matrix. | entailment |
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],
... | Matrix-vector product for complex triangular-packed matrix. | entailment |
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. | entailment |
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 real triangular-packed system with one right-hand side. | entailment |
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 side. | entailment |
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]... | Solve complex triangular-packed system with one right-hand size. | entailment |
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 complex triangular matrix. | entailment |
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 real triangular matrix. | entailment |
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. | entailment |
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... | Matrix-vector product for Hermitian-packed matrix. | entailment |
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. | entailment |
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 matrix. | entailment |
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. | entailment |
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-1 operation on Hermitian-packed matrix. | entailment |
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. | entailment |
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... | Rank-2 operation on Hermitian-packed matrix. | entailment |
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. | entailment |
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],... | Matrix-matrix product for real general matrix. | entailment |
def cublasZgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for complex general matrix.
"""
status = _libcublas.cublasZgemm_v2(handle,
_CUBLAS_OP[transa],
_CUBLAS_OP[trans... | Matrix-matrix product for complex general matrix. | entailment |
def cublasSsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for symmetric matrix.
"""
status = _libcublas.cublasSsymm_v2(handle,
_CUBLAS_SIDE_MODE[side],
_CUBLAS_FILL_MODE[u... | Matrix-matrix product for symmetric matrix. | entailment |
def cublasDsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for real symmetric matrix.
"""
status = _libcublas.cublasDsymm_v2(handle,
_CUBLAS_SIDE_MODE[side],
_CUBLAS_FILL_M... | Matrix-matrix product for real symmetric matrix. | entailment |
def cublasCsymm(handle, side, uplo, m, n, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Matrix-matrix product for complex symmetric matrix.
"""
status = _libcublas.cublasCsymm_v2(handle,
_CUBLAS_SIDE_MODE[side],
_CUBLAS_FI... | Matrix-matrix product for complex symmetric matrix. | entailment |
def cublasSsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc):
"""
Rank-k operation on real symmetric matrix.
"""
status = _libcublas.cublasSsyrk_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... | Rank-k operation on real symmetric matrix. | entailment |
def cublasDsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc):
"""
Rank-k operation on real symmetric matrix.
"""
status = _libcublas.cublasDsyrk_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... | Rank-k operation on real symmetric matrix. | entailment |
def cublasZsyrk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc):
"""
Rank-k operation on complex symmetric matrix.
"""
status = _libcublas.cublasZsyrk_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... | Rank-k operation on complex symmetric matrix. | entailment |
def cublasSsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Rank-2k operation on real symmetric matrix.
"""
status = _libcublas.cublasSsyr2k_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[tra... | Rank-2k operation on real symmetric matrix. | entailment |
def cublasDsyr2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Rank-2k operation on real symmetric matrix.
"""
status = _libcublas.cublasDsyr2k_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans]... | Rank-2k operation on real symmetric matrix. | entailment |
def cublasStrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc):
"""
Matrix-matrix product for real triangular matrix.
"""
status = _libcublas.cublasStrmm_v2(handle,
_CUBLAS_SIDE_MODE[side],
_CUBLA... | Matrix-matrix product for real triangular matrix. | entailment |
def cublasZtrmm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb, C, ldc):
"""
Matrix-matrix product for complex triangular matrix.
"""
status = _libcublas.cublasZtrmm_v2(handle,
_CUBLAS_SIDE_MODE[side],
_C... | Matrix-matrix product for complex triangular matrix. | entailment |
def cublasStrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb):
"""
Solve a real triangular system with multiple right-hand sides.
"""
status = _libcublas.cublasStrsm_v2(handle,
_CUBLAS_SIDE_MODE[side],
... | Solve a real triangular system with multiple right-hand sides. | entailment |
def cublasDtrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb):
"""
Solve a real triangular system with multiple right-hand sides.
"""
status = _libcublas.cublasDtrsm_v2(handle,
_CUBLAS_SIDE_MODE[side],
... | Solve a real triangular system with multiple right-hand sides. | entailment |
def cublasZtrsm(handle, side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb):
"""
Solve complex triangular system with multiple right-hand sides.
"""
status = _libcublas.cublasZtrsm_v2(handle,
_CUBLAS_SIDE_MODE[side],
... | Solve complex triangular system with multiple right-hand sides. | entailment |
def cublasZherk(handle, uplo, trans, n, k, alpha, A, lda, beta, C, ldc):
"""
Rank-k operation on Hermitian matrix.
"""
status = _libcublas.cublasZherk_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],
... | Rank-k operation on Hermitian matrix. | entailment |
def cublasCher2k(handle, uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc):
"""
Rank-2k operation on Hermitian matrix.
"""
status = _libcublas.cublasCher2k_v2(handle,
_CUBLAS_FILL_MODE[uplo],
_CUBLAS_OP[trans],... | Rank-2k operation on Hermitian matrix. | entailment |
def cublasSdgmm(handle, mode, m, n, A, lda, x, incx, C, ldc):
"""
Matrix-diagonal matrix product for real general matrix.
"""
status = _libcublas.cublasSdgmm(handle,
_CUBLAS_SIDE[mode],
m, n,
... | Matrix-diagonal matrix product for real general matrix. | entailment |
def load_EROS_lc(filename='lm0010n22323.time'):
"""
Read an EROS light curve and return its data.
Parameters
----------
filename : str, optional
A light-curve filename.
Returns
-------
dates : numpy.ndarray
An array of dates.
magnitudes : numpy.ndarray
An ar... | Read an EROS light curve and return its data.
Parameters
----------
filename : str, optional
A light-curve filename.
Returns
-------
dates : numpy.ndarray
An array of dates.
magnitudes : numpy.ndarray
An array of magnitudes.
errors : numpy.ndarray
An arr... | entailment |
def load_rf_model():
"""
Return the UPSILoN random forests classifier.
The classifier is trained using OGLE and EROS periodic variables
(Kim et al. 2015).
Returns
-------
clf : sklearn.ensemble.RandomForestClassifier
The UPSILoN random forests classifier.
"""
import gzip
... | Return the UPSILoN random forests classifier.
The classifier is trained using OGLE and EROS periodic variables
(Kim et al. 2015).
Returns
-------
clf : sklearn.ensemble.RandomForestClassifier
The UPSILoN random forests classifier. | entailment |
def sample_dropout_mask(x, dropout_probability=.5, columns=None, stream=None, target=None,
dropout_mask=None, dropout_prob_array=None):
""" Samples a dropout mask and applies it in place"""
assert x.flags.c_contiguous
if columns is not None:
assert len(columns) == 2
... | Samples a dropout mask and applies it in place | entailment |
def reads(s, filename=None, loader=None, implicit_tuple=True, allow_errors=False):
"""Load but don't evaluate a GCL expression from a string."""
return ast.reads(s,
filename=filename or '<input>',
loader=loader or default_loader,
implicit_tuple=implicit_tuple,
allow_errors=allow_errors) | Load but don't evaluate a GCL expression from a string. | entailment |
def read(filename, loader=None, implicit_tuple=True, allow_errors=False):
"""Load but don't evaluate a GCL expression from a file."""
with open(filename, 'r') as f:
return reads(f.read(),
filename=filename,
loader=loader,
implicit_tuple=implicit_tuple,
... | Load but don't evaluate a GCL expression from a file. | entailment |
def loads(s, filename=None, loader=None, implicit_tuple=True, env={}, schema=None):
"""Load and evaluate a GCL expression from a string."""
ast = reads(s, filename=filename, loader=loader, implicit_tuple=implicit_tuple)
if not isinstance(env, framework.Environment):
# For backwards compatibility we accept an ... | Load and evaluate a GCL expression from a string. | entailment |
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None):
"""Load and evaluate a GCL expression from a file."""
with open(filename, 'r') as f:
return loads(f.read(),
filename=filename,
loader=loader,
implicit_tuple=implicit_tuple,
... | Load and evaluate a GCL expression from a file. | entailment |
def linear_scheduler_up(init_value, target_value, duration):
""" Increases linearly and then stays flat """
value = init_value
t = 0
while True:
yield value
t += 1
if t < duration:
value = init_value + t * (target_value - init_value) / duration
else:
... | Increases linearly and then stays flat | entailment |
def linear_scheduler_up_down(init_value, target_value, final_value,
duration_up, t_decrease, duration_down):
""" Increases linearly to target_value, stays at target_value until
t_decrease and then decreases linearly
"""
value = init_value
t = 0
while True:
... | Increases linearly to target_value, stays at target_value until
t_decrease and then decreases linearly | entailment |
def load(stream, overrides=None, **kwargs):
"""
Loads a YAML configuration from a string or file-like object.
Parameters
----------
stream : str or object
Either a string containing valid YAML or a file-like object
supporting the .read() interface.
overrides : dict, optional
... | Loads a YAML configuration from a string or file-like object.
Parameters
----------
stream : str or object
Either a string containing valid YAML or a file-like object
supporting the .read() interface.
overrides : dict, optional
A dictionary containing overrides to apply. The loc... | entailment |
def load_path(path, overrides=None, **kwargs):
"""
Convenience function for loading a YAML configuration from a file.
Parameters
----------
path : str
The path to the file to load on disk.
overrides : dict, optional
A dictionary containing overrides to apply. The location of
... | Convenience function for loading a YAML configuration from a file.
Parameters
----------
path : str
The path to the file to load on disk.
overrides : dict, optional
A dictionary containing overrides to apply. The location of
the override is specified in the key as a dot-delimite... | entailment |
def handle_overrides(graph, overrides):
"""
Handle any overrides for this model configuration.
Parameters
----------
graph : dict or object
A dictionary (or an ObjectProxy) containing the object graph
loaded from a YAML file.
overrides : dict
A dictionary containing over... | Handle any overrides for this model configuration.
Parameters
----------
graph : dict or object
A dictionary (or an ObjectProxy) containing the object graph
loaded from a YAML file.
overrides : dict
A dictionary containing overrides to apply. The location of
the override... | entailment |
def instantiate_all(graph):
"""
Instantiate all ObjectProxy objects in a nested hierarchy.
Parameters
----------
graph : dict or object
A dictionary (or an ObjectProxy) containing the object graph
loaded from a YAML file.
Returns
-------
graph : dict or object
T... | Instantiate all ObjectProxy objects in a nested hierarchy.
Parameters
----------
graph : dict or object
A dictionary (or an ObjectProxy) containing the object graph
loaded from a YAML file.
Returns
-------
graph : dict or object
The dictionary or object resulting after ... | entailment |
def multi_constructor(loader, tag_suffix, node):
"""
Constructor function passed to PyYAML telling it how to construct
objects from argument descriptions. See PyYAML documentation for
details on the call signature.
"""
yaml_src = yaml.serialize(node)
mapping = loader.construct_mapping(node)
... | Constructor function passed to PyYAML telling it how to construct
objects from argument descriptions. See PyYAML documentation for
details on the call signature. | entailment |
def multi_constructor_pkl(loader, tag_suffix, node):
"""
Constructor function passed to PyYAML telling it how to load
objects from paths to .pkl files. See PyYAML documentation for
details on the call signature.
"""
mapping = loader.construct_yaml_str(node)
if tag_suffix != "" and tag_suffi... | Constructor function passed to PyYAML telling it how to load
objects from paths to .pkl files. See PyYAML documentation for
details on the call signature. | entailment |
def initialize():
"""
Initialize the configuration system by installing YAML handlers.
Automatically done on first call to load() specified in this file.
"""
global is_initialized
# Add the custom multi-constructor
yaml.add_multi_constructor('!obj:', multi_constructor)
yaml.add_multi_con... | Initialize the configuration system by installing YAML handlers.
Automatically done on first call to load() specified in this file. | entailment |
def instantiate(self):
"""
Instantiate this object with the supplied parameters in `self.kwds`,
or if already instantiated, return the cached instance.
"""
if self.instance is None:
self.instance = checked_call(self.cls, self.kwds)
#endif
try:
... | Instantiate this object with the supplied parameters in `self.kwds`,
or if already instantiated, return the cached instance. | entailment |
def feed_forward(self, input_data, prediction=False):
"""Propagate forward through the layer.
**Parameters:**
input_data : ``GPUArray``
Inpute data to compute activations for.
prediction : bool, optional
Whether to use prediction model. Only relevant when using... | Propagate forward through the layer.
**Parameters:**
input_data : ``GPUArray``
Inpute data to compute activations for.
prediction : bool, optional
Whether to use prediction model. Only relevant when using
dropout. If true, then weights are multiplied by
... | entailment |
def fasper(x, y, ofac, hifac, n_threads, MACC=4):
"""
Given abscissas x (which need not be equally spaced) and ordinates
y, and given a desired oversampling factor ofac (a typical value
being 4 or larger). this routine creates an array wk1 with a
sequence of nout increasing frequencies (not angular ... | Given abscissas x (which need not be equally spaced) and ordinates
y, and given a desired oversampling factor ofac (a typical value
being 4 or larger). this routine creates an array wk1 with a
sequence of nout increasing frequencies (not angular frequencies)
up to hifac times the "average" Nyquist frequ... | entailment |
def get_no_validate(self, key):
"""Return an item without validating the schema."""
x, env = self.get_thunk_env(key)
# Check if this is a Thunk that needs to be lazily evaluated before we
# return it.
if isinstance(x, framework.Thunk):
x = framework.eval(x, env)
return x | Return an item without validating the schema. | entailment |
def env(self, current_scope):
"""Return an environment that will look up in current_scope for keys in
this tuple, and the parent env otherwise.
"""
return self.__env_cache.get(
current_scope.ident,
framework.Environment, current_scope,
names=self.keys(),
p... | Return an environment that will look up in current_scope for keys in
this tuple, and the parent env otherwise. | entailment |
def get_thunk_env(self, k):
"""Return the thunk AND environment for validating it in for the given key.
There might be different envs in case the thunk comes from a different (composed) tuple. If the thunk needs its
environment bound on retrieval, that will be done here.
"""
if k not in self.__item... | Return the thunk AND environment for validating it in for the given key.
There might be different envs in case the thunk comes from a different (composed) tuple. If the thunk needs its
environment bound on retrieval, that will be done here. | entailment |
def attach_schema(self, schem):
"""Add a tuple schema to this object (externally imposed)"""
self.tuple_schema = schema.AndSchema.make(self.tuple_schema, schem) | Add a tuple schema to this object (externally imposed) | entailment |
def get_schema_spec(self, key):
"""Return the evaluated schema expression from a subkey."""
member_node = self._ast_node.member.get(key, None)
if not member_node:
return schema.AnySchema()
s = framework.eval(member_node.member_schema, self.env(self))
if not isinstance(s, schema.Schema):
... | Return the evaluated schema expression from a subkey. | entailment |
def get_required_fields(self):
"""Return the names of fields that are required according to the schema."""
return [m.name for m in self._ast_node.members if m.member_schema.required] | Return the names of fields that are required according to the schema. | entailment |
def get_member_node(self, key):
"""Return the AST node for the given member, from the first tuple that serves it."""
for tup, _ in self.lookups:
if key in tup:
return tup.get_member_node(key)
raise RuntimeError('Key not found in composite tuple: %r' % key) | Return the AST node for the given member, from the first tuple that serves it. | entailment |
def exportable_keys(self):
"""Return a list of keys that are exportable from this tuple.
Returns all keys that are not private in any of the tuples.
"""
keys = collections.defaultdict(list)
for tup in self._tuples:
for key, private in tup._keys_and_privacy().items():
keys[key].append(... | Return a list of keys that are exportable from this tuple.
Returns all keys that are not private in any of the tuples. | entailment |
def resolve(self, current_file, rel_path):
"""Search the filesystem."""
search_path = [path.dirname(current_file)] + self.search_path
target_path = None
for search in search_path:
if self.exists(path.join(search, rel_path)):
target_path = path.normpath(path.join(search, rel_path))
... | Search the filesystem. | entailment |
def resolve(self, current_file, rel_path):
"""Search the filesystem."""
p = path.join(path.dirname(current_file), rel_path)
if p not in self.file_dict:
raise RuntimeError('No such fake file: %r' % p)
return p, p | Search the filesystem. | entailment |
def check_call_arguments(to_call, kwargs):
"""
Check the call signature against a dictionary of proposed arguments,
raising an informative exception in the case of mismatch.
Parameters
----------
to_call : class or callable
Function or class to examine (in the case of classes, the
... | Check the call signature against a dictionary of proposed arguments,
raising an informative exception in the case of mismatch.
Parameters
----------
to_call : class or callable
Function or class to examine (in the case of classes, the
constructor call signature is analyzed)
kwargs :... | entailment |
def predict(rf_model, features):
"""
Return label and probability estimated.
Parameters
----------
rf_model : sklearn.ensemble.RandomForestClassifier
The UPSILoN random forests model.
features : array_like
A list of features estimated by UPSILoN.
Returns
-------
lab... | Return label and probability estimated.
Parameters
----------
rf_model : sklearn.ensemble.RandomForestClassifier
The UPSILoN random forests model.
features : array_like
A list of features estimated by UPSILoN.
Returns
-------
label : str
A predicted label (i.e. clas... | entailment |
def fmt(str, args=None, env=None):
"""fmt(string, [tuple]) -> string
Interpolate a string, replacing {patterns} with the variables with the same
name. If given a tuple, use the keys from the tuple to substitute. If not
given a tuple, uses the current environment as the variable source.
"""
# Normally, we'd... | fmt(string, [tuple]) -> string
Interpolate a string, replacing {patterns} with the variables with the same
name. If given a tuple, use the keys from the tuple to substitute. If not
given a tuple, uses the current environment as the variable source. | entailment |
def compose_all(tups):
"""Compose all given tuples together."""
from . import ast # I weep for humanity
return functools.reduce(lambda x, y: x.compose(y), map(ast.make_tuple, tups), ast.make_tuple({})) | Compose all given tuples together. | entailment |
def has_key(tup, key):
"""has(tuple, string) -> bool
Return whether a given tuple has a key and the key is bound.
"""
if isinstance(tup, framework.TupleLike):
return tup.is_bound(key)
if isinstance(tup, dict):
return key in tup
if isinstance(tup, list):
if not isinstance(key, int):
raise ... | has(tuple, string) -> bool
Return whether a given tuple has a key and the key is bound. | entailment |
def flatten(list_of_lists):
"""flatten([[A]]) -> [A]
Flatten a list of lists.
"""
ret = []
for lst in list_of_lists:
if not isinstance(lst, list):
raise ValueError('%r is not a list' % lst)
ret.extend(lst)
return ret | flatten([[A]]) -> [A]
Flatten a list of lists. | entailment |
def extract_dark(prihdr, scihdu):
"""Extract superdark data from ``DARKFILE`` or ``DRKCFILE``.
Parameters
----------
prihdr : obj
FITS primary header HDU.
scihdu : obj
Extension HDU of the science image.
This is only used to extract subarray data.
Returns
-------
... | Extract superdark data from ``DARKFILE`` or ``DRKCFILE``.
Parameters
----------
prihdr : obj
FITS primary header HDU.
scihdu : obj
Extension HDU of the science image.
This is only used to extract subarray data.
Returns
-------
dark : ndarray or `None`
Super... | entailment |
def extract_flash(prihdr, scihdu):
"""Extract postflash data from ``FLSHFILE``.
Parameters
----------
prihdr : obj
FITS primary header HDU.
scihdu : obj
Extension HDU of the science image.
This is only used to extract subarray data.
Returns
-------
flash : ndar... | Extract postflash data from ``FLSHFILE``.
Parameters
----------
prihdr : obj
FITS primary header HDU.
scihdu : obj
Extension HDU of the science image.
This is only used to extract subarray data.
Returns
-------
flash : ndarray or `None`
Postflash, if any. S... | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.