Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 5 new columns ({'y_neg', 'y_pos', 'retain', 'library', 'id'})
This happened while the json dataset builder was generating data using
hf://datasets/tummitum/Data-Collection/codegen/D_test_U_dep.json (at revision 07a1ca0083ab8b0a71c18a43195330cf495f475a), ['hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_nondep.json'], ['hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_nondep.json']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
self._write_table(pa_table, writer_batch_size=writer_batch_size)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
category: string
source: string
function: string
probing input: string
probing input new: string
reference: string
reference dict: extension<arrow.json>
alias dict: extension<arrow.json>
deprecated api: list<item: string>
child 0, item: string
replacement api: string
expected call: string
id: int64
library: string
retain: string
y_pos: string
y_neg: string
-- schema metadata --
huggingface: '{"info": {"features": {"category": {"dtype": "string", "_ty' + 794
to
{'category': Value('string'), 'source': Value('string'), 'function': Value('string'), 'probing input': Value('string'), 'probing input new': Value('string'), 'reference': Value('string'), 'reference dict': Json(decode=True), 'alias dict': Json(decode=True), 'deprecated api': List(Value('string')), 'replacement api': Value('string'), 'expected call': Value('string')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
...<4 lines>...
)
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 5 new columns ({'y_neg', 'y_pos', 'retain', 'library', 'id'})
This happened while the json dataset builder was generating data using
hf://datasets/tummitum/Data-Collection/codegen/D_test_U_dep.json (at revision 07a1ca0083ab8b0a71c18a43195330cf495f475a), ['hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_nondep.json'], ['hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codegen/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/codellama/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/deepseek/D_test_U_nondep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_dep.json', 'hf://datasets/tummitum/Data-Collection@07a1ca0083ab8b0a71c18a43195330cf495f475a/starcoder/D_test_U_nondep.json']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
category string | source string | function string | probing input string | probing input new string | reference string | reference dict string | alias dict string | deprecated api list | replacement api string | expected call string |
|---|---|---|---|---|---|---|---|---|---|---|
up-to-dated | sourcegraph | def make_array_interface(
ptr: CNumericPtr, shape: Tuple[int, ...], dtype: Type[np.number], is_cuda: bool
) -> Dict[str, Union[int, tuple, None]]:
"""Make an __(cuda)_array_interface__ from a pointer."""
# Use an empty array to handle typestr and descr
if is_cuda:
empty = import_cupy().empty(sha... | def make_array_interface(
ptr: CNumericPtr, shape: Tuple[int, ...], dtype: Type[np.number], is_cuda: bool
) -> Dict[str, Union[int, tuple, None]]:
"""Make an __(cuda)_array_interface__ from a pointer."""
# Use an empty array to handle typestr and descr
if is_cuda:
empty = import_cupy().empty(sha... | def make_array_interface(
ptr: CNumericPtr, shape: Tuple[int, ...], dtype: Type[np.number], is_cuda: bool
) -> Dict[str, Union[int, tuple, None]]:
"""Make an __(cuda)_array_interface__ from a pointer."""
# Use an empty array to handle typestr and descr
if is_cuda:
empty = import_cupy().empty(sha... | length=int(np.prod(shape)) | {"IterRange":"TypeVar"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def perform(self, node, inp, outs, params):
x = inp[0]
axes = params
max, max_idx = outs
if axes is None:
axes = tuple(range(x.ndim))
else:
axes = tuple(int(ax) for ax in axes)
max[0] = theano._asarray(np.max(x, axes),
... | def perform(self, node, inp, outs, params):
x = inp[0]
axes = params
max, max_idx = outs
if axes is None:
axes = tuple(range(x.ndim))
else:
axes = tuple(int(ax) for ax in axes)
max[0] = theano._asarray(np.max(x, axes),
... | def perform(self, node, inp, outs, params):
x = inp[0]
axes = params
max, max_idx = outs
if axes is None:
axes = tuple(range(x.ndim))
else:
axes = tuple(int(ax) for ax in axes)
max[0] = theano._asarray(np.max(x, axes),
... | new_shape=kept_shape+(np.prod(reduced_shape,dtype='int64'),) | {"cscalar":"TensorType","zscalar":"TensorType","fscalar":"TensorType","dscalar":"TensorType","bscalar":"TensorType","wscalar":"TensorType","iscalar":"TensorType","lscalar":"TensorType","cvector":"TensorType","zvector":"TensorType","fvector":"TensorType","dvector":"TensorType","bvector":"TensorType","wvector":"TensorTyp... | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def perform(self, node, inp, outs, params):
x, = inp
axes = self.axis
max_idx, = outs
if axes is None:
axes = tuple(range(x.ndim))
# Numpy does not support multiple axes for argmax
# Work around
keep_axes = np.array([i for i in range(x.ndim) if i ... | def perform(self, node, inp, outs, params):
x, = inp
axes = self.axis
max_idx, = outs
if axes is None:
axes = tuple(range(x.ndim))
# Numpy does not support multiple axes for argmax
# Work around
keep_axes = np.array([i for i in range(x.ndim) if i ... | def perform(self, node, inp, outs, params):
x, = inp
axes = self.axis
max_idx, = outs
if axes is None:
axes = tuple(range(x.ndim))
# Numpy does not support multiple axes for argmax
# Work around
keep_axes = np.array([i for i in range(x.ndim) if i ... | new_shape=kept_shape+(np.prod(reduced_shape),) | {"cscalar":"TensorType","zscalar":"TensorType","fscalar":"TensorType","dscalar":"TensorType","bscalar":"TensorType","wscalar":"TensorType","iscalar":"TensorType","lscalar":"TensorType","cvector":"TensorType","zvector":"TensorType","fvector":"TensorType","dvector":"TensorType","bvector":"TensorType","wvector":"TensorTyp... | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def perform(self, node, inp, out_):
x, = inp
out, = out_
outdim = self.outdim
if outdim == 1:
try:
out[0] = x.reshape(x.size)
except AttributeError:
out[0] = x.reshape((np.prod(x.shape),))
elif outdim == len(x.shape):
... | def perform(self, node, inp, out_):
x, = inp
out, = out_
outdim = self.outdim
if outdim == 1:
try:
out[0] = x.reshape(x.size)
except AttributeError:
out[0] = x.reshape((np.prod(x.shape),))
elif outdim == len(x.shape):
... | def perform(self, node, inp, out_):
x, = inp
out, = out_
outdim = self.outdim
if outdim == 1:
try:
out[0] = x.reshape(x.size)
except AttributeError:
out[0] = x.reshape((np.prod(x.shape),))
elif outdim == len(x.shape):
... | (np.prod(x.shape[outdim-1:]),)) | {"cscalar":"TensorType","zscalar":"TensorType","fscalar":"TensorType","dscalar":"TensorType","bscalar":"TensorType","wscalar":"TensorType","iscalar":"TensorType","lscalar":"TensorType","cvector":"TensorType","zvector":"TensorType","fvector":"TensorType","dvector":"TensorType","bvector":"TensorType","wvector":"TensorTyp... | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_keywords5_ticket_2100(self):
# Test vectorizing function with no kwargs args.
@vectorize
def f(*v):
return np.prod(v)
assert_array_equal(f([1, 2], [3, 4]), [3, 8]) | def test_keywords5_ticket_2100(self):
# Test vectorizing function with no kwargs args.
@vectorize
def f(*v):
| def test_keywords5_ticket_2100(self):
# Test vectorizing function with no kwargs args.
@vectorize
def f(*v):
return np. | returnnp.prod(v) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_check_mol_mp2(self):
# treating supercell at gamma point
supcell = super_cell(cell,nmp)
mf = scf.RHF(supcell,exxdiv=None).density_fit()
ehf = mf.kernel()
myadc = mol_adc.ADC(mf)
e_mp, t1, t2 = myadc.kernel_gs()
e_mp = e_mp/(numpy.prod(nmp))
... | def test_check_mol_mp2(self):
# treating supercell at gamma point
supcell = super_cell(cell,nmp)
mf = scf.RHF(supcell,exxdiv=None).density_fit()
ehf = mf.kernel()
myadc = mol_adc.ADC(mf)
e_mp, t1, t2 = myadc.kernel_gs()
| def test_check_mol_mp2(self):
# treating supercell at gamma point
supcell = super_cell(cell,nmp)
mf = scf.RHF(supcell,exxdiv=None).density_fit()
ehf = mf.kernel()
myadc = mol_adc.ADC(mf)
e_mp, t1, t2 = myadc.kernel_gs()
e_mp = e_mp/(numpy. | e_mp=e_mp/(numpy.prod(nmp)) | {"cell":"gto.M","myadc":"mol_adc.ADC"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_LinearFunction(self):
W = numpy.random.uniform(-1, 1, (1, numpy.prod(self.x.shape[1:])))
class Link(chainer.Chain):
def __call__(self, x):
return F.linear(x, W)
assert_export_import_match(Link(), self.x) | def test_LinearFunction(self):
| def test_LinearFunction(self):
W = numpy.random.uniform(-1, 1, (1, numpy. | W=numpy.random.uniform(-1,1,(1,numpy.prod(self.x.shape[1:]))) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def perform(self, node, inp, out_):
# This don't work as CudaNdarray_Subscript() don't support it.
#super(GpuAdvancedSubtensor1, self).perform(node, inp, out_)
x, idx = inp
out, = out_
x_orig = x
# TODO: if more than 3 dims, reshape the inputs even if not all
... | def perform(self, node, inp, out_):
# This don't work as CudaNdarray_Subscript() don't support it.
#super(GpuAdvancedSubtensor1, self).perform(node, inp, out_)
x, idx = inp
out, = out_
x_orig = x
# TODO: if more than 3 dims, reshape the inputs even if not all
... | def perform(self, node, inp, out_):
# This don't work as CudaNdarray_Subscript() don't support it.
#super(GpuAdvancedSubtensor1, self).perform(node, inp, out_)
x, idx = inp
out, = out_
x_orig = x
# TODO: if more than 3 dims, reshape the inputs even if not all
... | x=x.reshape((x.shape[0],numpy.prod(x.shape[1:]))) | {"host_from_gpu":"HostFromGpu","gpu_from_host":"GpuFromHost","gpu_shape":"GpuShape","gpu_join":"GpuJoin","gpu_alloc_empty":"GpuAllocEmpty","gpu_alloc":"GpuAlloc","cp_on_negative_strides":"CopyOnNegativeStrides","gpu_contiguous":"GpuContiguous","fscalar":"CudaNdarrayType","fvector":"CudaNdarrayType","fmatrix":"CudaNdarr... | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | mg.barrier()
regrid = esmpy.Regrid(srcfield, dstfield, filename=filename,
regrid_method=esmpy.RegridMethod.BILINEAR,
unmapped_action=esmpy.UnmappedAction.IGNORE)
# # create a regrid object from file
regrid = esmpy.RegridFromFile(srcfield, dstfield, filename)
# calculate the ... | mg.barrier()
regrid = esmpy.Regrid(srcfield, dstfield, filename=filename,
regrid_method=esmpy.RegridMethod.BILINEAR,
unmapped_action=esmpy.UnmappedAction.IGNORE)
# # create a regrid object from file
regrid = esmpy.RegridFromFile(srcfield, dstfield, filename)
# calculate the ... | mg.barrier()
regrid = esmpy.Regrid(srcfield, dstfield, filename=filename,
regrid_method=esmpy.RegridMethod.BILINEAR,
unmapped_action=esmpy.UnmappedAction.IGNORE)
# # create a regrid object from file
regrid = esmpy.RegridFromFile(srcfield, dstfield, filename)
# calculate the ... | num_nodes=numpy.prod(xctfield.data.shape[:]) | {"mg":"esmpy.Manager","srcgrid":"esmpy.Grid","dstgrid":"esmpy.Grid","srcfield":"esmpy.Field","dstfield":"esmpy.Field","xctfield":"esmpy.Field","regrid":"esmpy.RegridFromFile"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def __get_n_weights(
self, pre_shape: Tuple[int, ...],
post_n_atoms: int) -> int:
"""
Get the expected number of weights.
"""
shape = self.__get_pre_in_post_shape(pre_shape)
return numpy.prod(shape) * post_n_atoms | def __get_n_weights(
self, pre_shape: Tuple[int, ...],
post_n_atoms: int) -> int:
"""
Get the expected number of weights.
"""
shape = self.__get_pre_in_post_shape(pre_shape)
| def __get_n_weights(
self, pre_shape: Tuple[int, ...],
post_n_atoms: int) -> int:
"""
Get the expected number of weights.
"""
shape = self.__get_pre_in_post_shape(pre_shape)
return numpy. | returnnumpy.prod(shape)*post_n_atoms | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def img_to_bytes(image,
img_format = 'PNG'):
"""Convert image to bytes for storing in tf.Example proto.
Args:
image: Either numpy array or PIL image to be serialized.
img_format: Image serailization format.
Returns:
Serialized image.
Raises:
ValueError: if input image is empty.
... | def img_to_bytes(image,
img_format = 'PNG'):
"""Convert image to bytes for storing in tf.Example proto.
Args:
image: Either numpy array or PIL image to be serialized.
img_format: Image serailization format.
Returns:
Serialized image.
Raises:
ValueError: if input image is empty.
... | def img_to_bytes(image,
img_format = 'PNG'):
"""Convert image to bytes for storing in tf.Example proto.
Args:
image: Either numpy array or PIL image to be serialized.
img_format: Image serailization format.
Returns:
Serialized image.
Raises:
ValueError: if input image is empty.
... | ifnp.prod(np.shape(image))==0: | {"Array":"TypeVar","TBox":"TypeVar","image_bytes":"io.BytesIO"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_prod(self):
arr = [[1, 2, 3, 4],
[5, 6, 7, 9],
[10, 3, 4, 5]]
tgt = [24, 1890, 600]
assert_equal(np.prod(arr, axis=-1), tgt) | def test_prod(self):
arr = [[1, 2, 3, 4],
[5, 6, 7, 9],
[10, 3, 4, 5]]
tgt = [24, 1890, 600]
| def test_prod(self):
arr = [[1, 2, 3, 4],
[5, 6, 7, 9],
[10, 3, 4, 5]]
tgt = [24, 1890, 600]
assert_equal(np. | assert_equal(np.prod(arr,axis=-1),tgt) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_return_type(self):
class C(np.ndarray):
pass
for view in (C, np.ndarray):
for nd in range(1, 4):
shape = tuple(range(2, 2+nd))
x = np.arange(np.prod(shape)).reshape(shape).view(view)
for nzx in (np.nonzero(x), x.nonzer... | def test_return_type(self):
class C(np.ndarray):
pass
for view in (C, np.ndarray):
for nd in range(1, 4):
shape = tuple(range(2, 2+nd))
| def test_return_type(self):
class C(np.ndarray):
pass
for view in (C, np.ndarray):
for nd in range(1, 4):
shape = tuple(range(2, 2+nd))
x = np.arange(np. | x=np.arange(np.prod(shape)).reshape(shape).view(view) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_mean_values(self):
for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1]:
tgt = mat.sum(axis=axis)
res = _mean(mat, axis=axis) * mat.shape[axis]
assert_almost_equal(res, tgt)
for axis in [None]:
tgt =... | def test_mean_values(self):
for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1]:
tgt = mat.sum(axis=axis)
res = _mean(mat, axis=axis) * mat.shape[axis]
assert_almost_equal(res, tgt)
for axis in [None]:
tgt =... | def test_mean_values(self):
for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1]:
tgt = mat.sum(axis=axis)
res = _mean(mat, axis=axis) * mat.shape[axis]
assert_almost_equal(res, tgt)
for axis in [None]:
tgt =... | res=_mean(mat,axis=axis)*np.prod(mat.shape) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_accelerate_framework_sgemv_fix(self):
def aligned_array(shape, align, dtype, order='C'):
d = dtype(0)
N = np.prod(shape)
tmp = np.zeros(N * d.nbytes + align, dtype=np.uint8)
address = tmp.__array_interface__["data"][0]
for offset in range... | def test_accelerate_framework_sgemv_fix(self):
def aligned_array(shape, align, dtype, order='C'):
d = dtype(0)
| def test_accelerate_framework_sgemv_fix(self):
def aligned_array(shape, align, dtype, order='C'):
d = dtype(0)
N = np. | N=np.prod(shape) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_shapes(self, a_shape: tuple[int, ...], b_shape: tuple[int, ...]):
a_size = np.prod(a_shape)
a = np.arange(a_size).reshape(a_shape).astype(np.float64)
a_id = id(a)
b_size = np.prod(b_shape)
b = np.arange(b_size).reshape(b_shape)
ref = a @ b
if ref.sh... | def test_shapes(self, a_shape: tuple[int, ...], b_shape: tuple[int, ...]):
| def test_shapes(self, a_shape: tuple[int, ...], b_shape: tuple[int, ...]):
a_size = np. | a_size=np.prod(a_shape) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_no_suboffsets(self):
try:
import _testbuffer
except ImportError:
raise pytest.skip("_testbuffer is not available")
for shape in [(2, 3), (2, 3, 4)]:
data = list(range(np.prod(shape)))
buffer = _testbuffer.ndarray(data, shape, format='... | def test_no_suboffsets(self):
try:
import _testbuffer
except ImportError:
raise pytest.skip("_testbuffer is not available")
for shape in [(2, 3), (2, 3, 4)]:
| def test_no_suboffsets(self):
try:
import _testbuffer
except ImportError:
raise pytest.skip("_testbuffer is not available")
for shape in [(2, 3), (2, 3, 4)]:
data = list(range(np. | data=list(range(np.prod(shape))) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def _check_nd_one(self, routine, dtype, shape, axes, overwritable_dtypes,
overwrite_x):
np.random.seed(1234)
if np.issubdtype(dtype, np.complexfloating):
data = np.random.randn(*shape) + 1j*np.random.randn(*shape)
else:
data = np.random.randn(*sh... | def _check_nd_one(self, routine, dtype, shape, axes, overwritable_dtypes,
overwrite_x):
np.random.seed(1234)
if np.issubdtype(dtype, np.complexfloating):
data = np.random.randn(*shape) + 1j*np.random.randn(*shape)
else:
data = np.random.randn(*sh... | def _check_nd_one(self, routine, dtype, shape, axes, overwritable_dtypes,
overwrite_x):
np.random.seed(1234)
if np.issubdtype(dtype, np.complexfloating):
data = np.random.randn(*shape) + 1j*np.random.randn(*shape)
else:
data = np.random.randn(*sh... | np.prod(shape)<=np.prod(s) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def offcore_array(
shape: Union[Tuple[int, ...], Generator[int, None, None]],
dtype: numpy.dtype,
force_memmap: bool = False,
zarr_allowed: bool = False,
no_memmap_limit: bool = True,
max_memory_usage_ratio: float = 0.9,
):
"""
Instanciates an array of given shape and dtype in 'off-core... | def offcore_array(
shape: Union[Tuple[int, ...], Generator[int, None, None]],
dtype: numpy.dtype,
force_memmap: bool = False,
zarr_allowed: bool = False,
no_memmap_limit: bool = True,
max_memory_usage_ratio: float = 0.9,
):
"""
Instanciates an array of given shape and dtype in 'off-core... | def offcore_array(
shape: Union[Tuple[int, ...], Generator[int, None, None]],
dtype: numpy.dtype,
force_memmap: bool = False,
zarr_allowed: bool = False,
no_memmap_limit: bool = True,
max_memory_usage_ratio: float = 0.9,
):
"""
Instanciates an array of given shape and dtype in 'off-core... | size_in_bytes=numpy.prod(shape)*numpy.dtype(dtype).itemsize | {"temp_file":"tempfile.NamedTemporaryFile"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def combine(args):
"""
All linear combination of a list of list.
Args:
args (numpy.ndarray):
List of input arrays. Components to take linear combination of
with ``args[i].shape == (N[i], M[i])`` where ``N`` is to be taken
linear combination of and ``M`` is const... | def combine(args):
"""
All linear combination of a list of list.
Args:
args (numpy.ndarray):
List of input arrays. Components to take linear combination of
with ``args[i].shape == (N[i], M[i])`` where ``N`` is to be taken
linear combination of and ``M`` is const... | def combine(args):
"""
All linear combination of a list of list.
Args:
args (numpy.ndarray):
List of input arrays. Components to take linear combination of
with ``args[i].shape == (N[i], M[i])`` where ``N`` is to be taken
linear combination of and ``M`` is const... | size=numpy.prod(shapes,0)[0]*numpy.sum(shapes,0)[1] | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def combine_quadrature(
abscissas,
weights,
domain=(),
):
"""
Create all linear combinations of all abscissas and weights. If ``domain``
is provided, also scale from assumed (0, 1) to said domain.
Args:
abscissas (List[numpy.ndarray]):
List of abscissas to be combined.
... | def combine_quadrature(
abscissas,
weights,
domain=(),
):
"""
Create all linear combinations of all abscissas and weights. If ``domain``
is provided, also scale from assumed (0, 1) to said domain.
Args:
abscissas (List[numpy.ndarray]):
List of abscissas to be combined.
... | def combine_quadrature(
abscissas,
weights,
domain=(),
):
"""
Create all linear combinations of all abscissas and weights. If ``domain``
is provided, also scale from assumed (0, 1) to said domain.
Args:
abscissas (List[numpy.ndarray]):
List of abscissas to be combined.
... | weights=numpy.prod(weights,-1) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def reshape(self, new_shape):
if not isinstance(new_shape, tuple):
raise TypeError("new_shape 必须是一个元组(tuple)。")
if not all(isinstance(dim, int) for dim in new_shape):
raise TypeError("new_shape 中的所有元素都必须是整型(int)。")
assert np.prod(new_shape) == np.prod(self.d... | def reshape(self, new_shape):
if not isinstance(new_shape, tuple):
raise TypeError("new_shape 必须是一个元组(tuple)。")
if not all(isinstance(dim, int) for dim in new_shape):
raise TypeError("new_shape 中的所有元素都必须是整型(int)。")
| def reshape(self, new_shape):
if not isinstance(new_shape, tuple):
raise TypeError("new_shape 必须是一个元组(tuple)。")
if not all(isinstance(dim, int) for dim in new_shape):
raise TypeError("new_shape 中的所有元素都必须是整型(int)。")
assert np. | assertnp.prod(new_shape)==np.prod(self.data.shape),"新形状的元素总数必须与原始形状相同" | {"out":"Tensor"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def project_ball(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: array
:type array: numpy.ndarray
:param epsilon: radius of ball... | def project_ball(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: array
:type array: numpy.ndarray
:param epsilon: radius of ball... | def project_ball(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: array
:type array: numpy.ndarray
:param epsilon: radius of ball... | flattened_size=numpy.prod(numpy.array(size[1:])) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
if self.etype == "custom":
return self.encoder.conv_subsampling_factor * int(
numpy.prod(self.subsample)
)
else:
return self.enc.conv_subsampling_factor * int(numpy... | def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
if self.etype == "custom":
return self.encoder.conv_subsampling_factor * int(
| def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
if self.etype == "custom":
return self.encoder.conv_subsampling_factor * int(
numpy. | numpy.prod(self.subsample) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def get_conv_2d_filter(filter_shape, param_list = None, masktype = None, name = ""):
fan_in = numpy.prod(filter_shape[1:])
fan_out = (filter_shape[0] * numpy.prod(filter_shape[2:]))
w_std = numpy.sqrt(2.0 / (fan_in + fan_out))
filter_init = uniform(w_std, filter_shape)
if masktype is not None:
filter_init *= ... | def get_conv_2d_filter(filter_shape, param_list = None, masktype = None, name = ""):
| def get_conv_2d_filter(filter_shape, param_list = None, masktype = None, name = ""):
fan_in = numpy. | fan_in=numpy.prod(filter_shape[1:]) | {"srng":"RandomStreams"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_linalg_lstsq(self, device, dtype):
from torch.testing._internal.common_utils import random_well_conditioned_matrix
if self.device_type == 'cpu':
drivers = ('gels', 'gelsy', 'gelsd', 'gelss', None)
else:
drivers = ('gels', None)
def check_solution_cor... | def test_linalg_lstsq(self, device, dtype):
from torch.testing._internal.common_utils import random_well_conditioned_matrix
if self.device_type == 'cpu':
drivers = ('gels', 'gelsy', 'gelsd', 'gelss', None)
else:
drivers = ('gels', None)
def check_solution_cor... | def test_linalg_lstsq(self, device, dtype):
from torch.testing._internal.common_utils import random_well_conditioned_matrix
if self.device_type == 'cpu':
drivers = ('gels', 'gelsy', 'gelsd', 'gelss', None)
else:
drivers = ('gels', None)
def check_solution_cor... | batch_size=int(np.prod(a.shape[:-2])) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_tensorsolve_errors_and_warnings(self, device, dtype):
# tensorsolve expects the input that can be reshaped to a square matrix
a = torch.eye(2 * 3 * 4, dtype=dtype, device=device).reshape((2 * 3, 4, 2, 3, 4))
b = torch.randn(8, 4, dtype=dtype, device=device)
self.assertTrue(n... | def test_tensorsolve_errors_and_warnings(self, device, dtype):
# tensorsolve expects the input that can be reshaped to a square matrix
a = torch.eye(2 * 3 * 4, dtype=dtype, device=device).reshape((2 * 3, 4, 2, 3, 4))
b = torch.randn(8, 4, dtype=dtype, device=device)
| def test_tensorsolve_errors_and_warnings(self, device, dtype):
# tensorsolve expects the input that can be reshaped to a square matrix
a = torch.eye(2 * 3 * 4, dtype=dtype, device=device).reshape((2 * 3, 4, 2, 3, 4))
b = torch.randn(8, 4, dtype=dtype, device=device)
self.assertTrue(n... | self.assertTrue(np.prod(a.shape[2:])!=np.prod(b.shape)) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_tensorinv_singular_input(self, device, dtype):
def check_singular_input(a_shape, ind):
prod_ind_end = np.prod(a_shape[ind:])
a = torch.eye(prod_ind_end, dtype=dtype, device=device)
a[-1, -1] = 0 # Now `a` is singular
a = a.reshape(a_shape)
... | def test_tensorinv_singular_input(self, device, dtype):
def check_singular_input(a_shape, ind):
| def test_tensorinv_singular_input(self, device, dtype):
def check_singular_input(a_shape, ind):
prod_ind_end = np. | prod_ind_end=np.prod(a_shape[ind:]) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_slogdet(self, device, dtype):
from torch.testing._internal.common_utils import (random_hermitian_matrix, random_hermitian_psd_matrix,
random_hermitian_pd_matrix, random_square_matrix_of_rank)
# mat_chars denotes matrix characteristi... | def test_slogdet(self, device, dtype):
from torch.testing._internal.common_utils import (random_hermitian_matrix, random_hermitian_psd_matrix,
random_hermitian_pd_matrix, random_square_matrix_of_rank)
# mat_chars denotes matrix characteristi... | def test_slogdet(self, device, dtype):
from torch.testing._internal.common_utils import (random_hermitian_matrix, random_hermitian_psd_matrix,
random_hermitian_pd_matrix, random_square_matrix_of_rank)
# mat_chars denotes matrix characteristi... | num_matrices=np.prod(batchdims) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def compute_local_sums(I, J, filt, stride, padding, win):
I2 = I * I
J2 = J * J
IJ = I * J
I_sum = F.conv3d(I, filt, stride=stride, padding=padding)
J_sum = F.conv3d(J, filt, stride=stride, padding=padding)
I2_sum = F.conv3d(I2, filt, stride=stride, padding=padding)
J2_sum = F.conv3d(J2, fi... | def compute_local_sums(I, J, filt, stride, padding, win):
I2 = I * I
J2 = J * J
IJ = I * J
I_sum = F.conv3d(I, filt, stride=stride, padding=padding)
J_sum = F.conv3d(J, filt, stride=stride, padding=padding)
I2_sum = F.conv3d(I2, filt, stride=stride, padding=padding)
J2_sum = F.conv3d(J2, fi... | def compute_local_sums(I, J, filt, stride, padding, win):
I2 = I * I
J2 = J * J
IJ = I * J
I_sum = F.conv3d(I, filt, stride=stride, padding=padding)
J_sum = F.conv3d(J, filt, stride=stride, padding=padding)
I2_sum = F.conv3d(I2, filt, stride=stride, padding=padding)
J2_sum = F.conv3d(J2, fi... | win_size=np.prod(win) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def get_size(self, shape_info):
if shape_info:
return numpy.prod(shape_info) * numpy.dtype(self.dtype).itemsize
else:
return numpy.dtype(self.dtype).itemsize | def get_size(self, shape_info):
if shape_info:
| def get_size(self, shape_info):
if shape_info:
return numpy. | returnnumpy.prod(shape_info)*numpy.dtype(self.dtype).itemsize | {"gpu_context_type":"GpuContextType"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def _GetSelfAdjointEigTest(dtype_, shape_, compute_v_):
def CompareEigenVectors(self, x, y, tol):
x = EquilibrateEigenVectorPhases(x, y)
self.assertAllClose(x, y, atol=tol)
def CompareEigenDecompositions(self, x_e, x_v, y_e, y_v, tol):
num_batches = int(np.prod(x_e.shape[:-1]))
n = x_e.shape[-1]
... | def _GetSelfAdjointEigTest(dtype_, shape_, compute_v_):
def CompareEigenVectors(self, x, y, tol):
x = EquilibrateEigenVectorPhases(x, y)
self.assertAllClose(x, y, atol=tol)
def CompareEigenDecompositions(self, x_e, x_v, y_e, y_v, tol):
| def _GetSelfAdjointEigTest(dtype_, shape_, compute_v_):
def CompareEigenVectors(self, x, y, tol):
x = EquilibrateEigenVectorPhases(x, y)
self.assertAllClose(x, y, atol=tol)
def CompareEigenDecompositions(self, x_e, x_v, y_e, y_v, tol):
num_batches = int(np. | num_batches=int(np.prod(x_e.shape[:-1])) | {"x":"EquilibrateEigenVectorPhases","x_ei, x_vi":"SortEigenDecomposition","y_ei, y_vi":"SortEigenDecomposition"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_gh_21022():
# testing for absence of reported error
source = np.ma.masked_array(data=[-1, -1], mask=True, dtype=np.float64)
axis = np.array(0)
result = np.prod(source, axis=axis, keepdims=False)
result = np.ma.masked_array(result,
mask=np.ones(result.shape, d... | def test_gh_21022():
# testing for absence of reported error
source = np.ma.masked_array(data=[-1, -1], mask=True, dtype=np.float64)
axis = np.array(0)
| def test_gh_21022():
# testing for absence of reported error
source = np.ma.masked_array(data=[-1, -1], mask=True, dtype=np.float64)
axis = np.array(0)
result = np. | result=np.prod(source,axis=axis,keepdims=False) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def _compute_l2_norm(val, eps):
shape = val.shape
rank = len(shape)
batch_dims = rank - 3
if batch_dims == 0:
square_sum = np.sum(val**2)
output = val / np.power(square_sum + eps, 0.5)
else:
batch_dim_prod = np.prod(shape[:batch_dims])
... | def _compute_l2_norm(val, eps):
shape = val.shape
rank = len(shape)
batch_dims = rank - 3
if batch_dims == 0:
square_sum = np.sum(val**2)
output = val / np.power(square_sum + eps, 0.5)
else:
| def _compute_l2_norm(val, eps):
shape = val.shape
rank = len(shape)
batch_dims = rank - 3
if batch_dims == 0:
square_sum = np.sum(val**2)
output = val / np.power(square_sum + eps, 0.5)
else:
batch_dim_prod = np. | batch_dim_prod=np.prod(shape[:batch_dims]) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def _np_layer_norm(x, axes, gamma=None, beta=None, epsilon=1e-5):
rank = len(x.shape)
axes = [axis + rank if axis < 0 else axis for axis in axes]
normalized_shape = [x.shape[i] if i in axes else 1 for i in range(rank)]
gamma = (
np.ones(shape=normalized_shape)
... | def _np_layer_norm(x, axes, gamma=None, beta=None, epsilon=1e-5):
rank = len(x.shape)
axes = [axis + rank if axis < 0 else axis for axis in axes]
normalized_shape = [x.shape[i] if i in axes else 1 for i in range(rank)]
gamma = (
np.ones(shape=normalized_shape)
... | def _np_layer_norm(x, axes, gamma=None, beta=None, epsilon=1e-5):
rank = len(x.shape)
axes = [axis + rank if axis < 0 else axis for axis in axes]
normalized_shape = [x.shape[i] if i in axes else 1 for i in range(rank)]
gamma = (
np.ones(shape=normalized_shape)
... | np.sum(np.square(num),axis=tuple(axes),keepdims=True)/np.prod(normalized_shape) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def _create_dummy_array_for_dot(xp, shape, dtype):
x = numpy.arange(numpy.prod(shape)).reshape(shape)
if dtype == 'bool_':
x = numpy.asarray(x % 2 == 0)
else:
x = x.astype(dtype)
return xp.array(x) | def _create_dummy_array_for_dot(xp, shape, dtype):
| def _create_dummy_array_for_dot(xp, shape, dtype):
x = numpy.arange(numpy. | x=numpy.arange(numpy.prod(shape)).reshape(shape) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_sum_to(self):
n_elems = numpy.prod(self.in_shape)
x = numpy.arange(1, n_elems + 1, dtype=numpy.float32).reshape(
self.in_shape)
y_actual = array.sum_to(x, self.out_shape)
y_expect = numpy.zeros(self.out_shape, x.dtype)
for dst, src in numpy.nditer(
... | def test_sum_to(self):
| def test_sum_to(self):
n_elems = numpy. | n_elems=numpy.prod(self.in_shape) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_testAddSumProd(self):
# Test add, sum, product.
(x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
assert_(eq(np.add.reduce(x), add.reduce(x)))
assert_(eq(np.add.accumulate(x), add.accumulate(x)))
assert_(eq(4, sum(array(4), axis=0)))
assert_(eq(4, sum(array(... | def test_testAddSumProd(self):
# Test add, sum, product.
(x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
assert_(eq(np.add.reduce(x), add.reduce(x)))
assert_(eq(np.add.accumulate(x), add.accumulate(x)))
assert_(eq(4, sum(array(4), axis=0)))
assert_(eq(4, sum(array(... | def test_testAddSumProd(self):
# Test add, sum, product.
(x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
assert_(eq(np.add.reduce(x), add.reduce(x)))
assert_(eq(np.add.accumulate(x), add.accumulate(x)))
assert_(eq(4, sum(array(4), axis=0)))
assert_(eq(4, sum(array(... | assert_(eq(np.prod(x,axis=0),product(x,axis=0))) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_convolution(self):
# print '\n\n*************************************************'
# print ' TEST CONVOLUTION'
# print '*************************************************'
# fixed parameters
bsize = 10 # batch size
imshp = (28, 28)
kshp = (... | def test_convolution(self):
# print '\n\n*************************************************'
# print ' TEST CONVOLUTION'
# print '*************************************************'
# fixed parameters
bsize = 10 # batch size
imshp = (28, 28)
kshp = (... | def test_convolution(self):
# print '\n\n*************************************************'
# print ' TEST CONVOLUTION'
# print '*************************************************'
# fixed parameters
bsize = 10 # batch size
imshp = (28, 28)
kshp = (... | filters=rng.randn(nkern,numpy.prod(kshp)) | {"rng":"numpy.random.RandomState"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_multilayer_conv(self):
# fixed parameters
bsize = 10 # batch size
imshp = (5, 5)
kshp = ((3, 3), (2, 2))
nkerns = (3, 6) # per output pixel
ssizes = (((1, 1), (2, 2)),)
convmodes = ('full',) # 'valid',)
# symbolic stuff
kerns = ... | def test_multilayer_conv(self):
# fixed parameters
bsize = 10 # batch size
imshp = (5, 5)
kshp = ((3, 3), (2, 2))
nkerns = (3, 6) # per output pixel
ssizes = (((1, 1), (2, 2)),)
convmodes = ('full',) # 'valid',)
# symbolic stuff
kerns = ... | def test_multilayer_conv(self):
# fixed parameters
bsize = 10 # batch size
imshp = (5, 5)
kshp = ((3, 3), (2, 2))
nkerns = (3, 6) # per output pixel
ssizes = (((1, 1), (2, 2)),)
convmodes = ('full',) # 'valid',)
# symbolic stuff
kerns = ... | img2d=numpy.arange(bsize*numpy.prod(imshp)).reshape((bsize,)+imshp) | {"rng":"numpy.random.RandomState"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def num_params(self, print_out=True):
parameters = filter(lambda p: p.requires_grad, self.parameters())
parameters = sum([np.prod(p.size()) for p in parameters]) / 1_000_000
if print_out:
print('Trainable Parameters: %.3fM' % parameters)
return parameters | def num_params(self, print_out=True):
parameters = filter(lambda p: p.requires_grad, self.parameters())
| def num_params(self, print_out=True):
parameters = filter(lambda p: p.requires_grad, self.parameters())
parameters = sum([np. | parameters=sum([np.prod(p.size())forpinparameters])/1_000_000 | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def num_params(self):
parameters = filter(lambda p: p.requires_grad, self.parameters())
parameters = sum([np.prod(p.size()) for p in parameters]) / 1_000_000
logger.debug("Trainable Parameters: %.3fM" % parameters) | def num_params(self):
parameters = filter(lambda p: p.requires_grad, self.parameters())
| def num_params(self):
parameters = filter(lambda p: p.requires_grad, self.parameters())
parameters = sum([np. | parameters=sum([np.prod(p.size())forpinparameters])/1_000_000 | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def testHeightMap(self):
"""Test height map items"""
sceneWidget = self.window.getSceneWidget()
height = numpy.arange(10000).reshape(100, 100) / 100.0
for shape in ((100, 100), (4, 5), (150, 20), (110, 110)):
with self.subTest(shape=shape):
items = []
... | def testHeightMap(self):
"""Test height map items"""
sceneWidget = self.window.getSceneWidget()
height = numpy.arange(10000).reshape(100, 100) / 100.0
for shape in ((100, 100), (4, 5), (150, 20), (110, 110)):
with self.subTest(shape=shape):
items = []
... | def testHeightMap(self):
"""Test height map items"""
sceneWidget = self.window.getSceneWidget()
height = numpy.arange(10000).reshape(100, 100) / 100.0
for shape in ((100, 100), (4, 5), (150, 20), (110, 110)):
with self.subTest(shape=shape):
items = []
... | numpy.arange(numpy.prod(shape)).astype(numpy.float32).reshape(shape) | {"heightmap":"HeightMapRGBA"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def size(self):
return np.prod(self.shape).item() | def size(self):
| def size(self):
return np. | returnnp.prod(self.shape).item() | {"self._shape":"TupleField","self._order":"ReferenceField","self._dtype":"DataTypeField"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def nbytes(self):
return np.prod(self.shape) * self.dtype.itemsize | def nbytes(self):
| def nbytes(self):
return np. | returnnp.prod(self.shape)*self.dtype.itemsize | {"self._shape":"TupleField","self._order":"ReferenceField","self._dtype":"DataTypeField"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def stencil_grid(S, grid, dtype=None, format=None):
N_v = int(numpy.prod(grid)) # number of vertices in the mesh
N_s = int((S != 0).sum()) # number of nonzero stencil entries
# diagonal offsets
diags = np.zeros(N_s, dtype=int)
# compute index offset of each dof within the stencil
strides = n... | def stencil_grid(S, grid, dtype=None, format=None):
| def stencil_grid(S, grid, dtype=None, format=None):
N_v = int(numpy. | N_v=int(numpy.prod(grid)) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def __get_nan_frequency(cls, data):
return cls.__get_nan_count(data) / (np.prod(data.shape) or 1) | def __get_nan_frequency(cls, data):
| def __get_nan_frequency(cls, data):
return cls.__get_nan_count(data) / (np. | returncls.__get_nan_count(data)/(np.prod(data.shape)or1) | {"self.domain":"Domain","self._next_instance_lock":"Lock"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def get_nan_frequency_metas(self):
return self.get_nan_count_metas() / (np.prod(self.metas.shape) or 1) | def get_nan_frequency_metas(self):
| def get_nan_frequency_metas(self):
return self.get_nan_count_metas() / (np. | returnself.get_nan_count_metas()/(np.prod(self.metas.shape)or1) | {"self.domain":"Domain","self._next_instance_lock":"Lock"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
return self.encoder.conv_subsampling_factor * int(numpy.prod(self.subsample)) | def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
| def get_total_subsampling_factor(self):
"""Get total subsampling factor."""
return self.encoder.conv_subsampling_factor * int(numpy. | returnself.encoder.conv_subsampling_factor*int(numpy.prod(self.subsample)) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def read_batch(self, batch_size: int) -> Optional[np.ndarray]:
if self.idx >= self.shape[0]:
return None
bs = min(batch_size, self.shape[0] - self.idx)
self.idx += bs
if self.dtype.itemsize == 0:
return np.ndarray([bs, *self.shape[1:]], dtype=self.dtype)
... | def read_batch(self, batch_size: int) -> Optional[np.ndarray]:
if self.idx >= self.shape[0]:
return None
bs = min(batch_size, self.shape[0] - self.idx)
self.idx += bs
if self.dtype.itemsize == 0:
return np.ndarray([bs, *self.shape[1:]], dtype=self.dtype)
| def read_batch(self, batch_size: int) -> Optional[np.ndarray]:
if self.idx >= self.shape[0]:
return None
bs = min(batch_size, self.shape[0] - self.idx)
self.idx += bs
if self.dtype.itemsize == 0:
return np.ndarray([bs, *self.shape[1:]], dtype=self.dtype)
... | read_count=bs*np.prod(self.shape[1:]) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def cheb1ap(N, rp):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rp` decibels of ripple in the passband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first drops below ``... | def cheb1ap(N, rp):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rp` decibels of ripple in the passband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first drops below ``... | def cheb1ap(N, rp):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rp` decibels of ripple in the passband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first drops below ``... | k=numpy.prod(-p,axis=0).real | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def cheb2ap(N, rs):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rs` decibels of ripple in the stopband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first reaches ``-rs`... | def cheb2ap(N, rs):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rs` decibels of ripple in the stopband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first reaches ``-rs`... | def cheb2ap(N, rs):
"""
Return (z,p,k) for Nth-order Chebyshev type I analog lowpass filter.
The returned filter prototype has `rs` decibels of ripple in the stopband.
The filter's angular (e.g. rad/s) cutoff frequency is normalized to 1,
defined as the point at which the gain first reaches ``-rs`... | k=(numpy.prod(-p,axis=0)/numpy.prod(-z,axis=0)).real | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def _norm_factor(p, k):
"""
Numerically find frequency shift to apply to delay-normalized filter such
that -3 dB point is at 1 rad/sec.
`p` is an array_like of polynomial poles
`k` is a float gain
First 10 values are listed in "Bessel Scale Factors" table,
"Bessel Filters Polynomials, Pole... | def _norm_factor(p, k):
"""
Numerically find frequency shift to apply to delay-normalized filter such
that -3 dB point is at 1 rad/sec.
`p` is an array_like of polynomial poles
`k` is a float gain
First 10 values are listed in "Bessel Scale Factors" table,
"Bessel Filters Polynomials, Pole... | def _norm_factor(p, k):
"""
Numerically find frequency shift to apply to delay-normalized filter such
that -3 dB point is at 1 rad/sec.
`p` is an array_like of polynomial poles
`k` is a float gain
First 10 values are listed in "Bessel Scale Factors" table,
"Bessel Filters Polynomials, Pole... | returnabs(k/prod(1j*w-p)) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | prod |
up-to-dated | sourcegraph | def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
x = (1 + np.linspace(0, 5, np.prod(xs))).astype(dtype).reshape(xs)
y = (1 + np.linspace(0, 5, np.prod(ys))).astype(dtype).reshape(ys)
self._compareCpu(x, y, np_func, tf_func)
if x.dtype in (np.float16, np.float32, np.float64):
if tf_func ... | def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
| def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
x = (1 + np.linspace(0, 5, np. | x=(1+np.linspace(0,5,np.prod(xs))).astype(dtype).reshape(xs) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
x = np.linspace(-15, 15, np.prod(xs)).astype(dtype).reshape(xs)
y = np.linspace(20, -10, np.prod(ys)).astype(dtype).reshape(ys)
self._compareCpu(x, y, np_func, tf_func)
self._compareCpu(y, x, np_func, tf_func)
if x.dtype == np.float16 or x.... | def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
| def _compareBCast(self, xs, ys, dtype, np_func, tf_func):
x = np.linspace(-15, 15, np. | x=np.linspace(-15,15,np.prod(xs)).astype(dtype).reshape(xs) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def testBCast(self):
shapes = [
([1, 3, 2], [1]),
([1, 3, 2], [2]),
([1, 3, 2], [3, 2]),
([1, 3, 2], [3, 1]),
([1, 3, 2], [1, 3, 2]),
([1, 3, 2], [2, 3, 1]),
([1, 3, 2], [2, 1, 1]),
([1, 3, 2], [1, 3, 1]),
([2, 1, 5], [2, 3, 1]),
([2,... | def testBCast(self):
shapes = [
([1, 3, 2], [1]),
([1, 3, 2], [2]),
([1, 3, 2], [3, 2]),
([1, 3, 2], [3, 1]),
([1, 3, 2], [1, 3, 2]),
([1, 3, 2], [2, 3, 1]),
([1, 3, 2], [2, 1, 1]),
([1, 3, 2], [1, 3, 1]),
([2, 1, 5], [2, 3, 1]),
([2,... | def testBCast(self):
shapes = [
([1, 3, 2], [1]),
([1, 3, 2], [2]),
([1, 3, 2], [3, 2]),
([1, 3, 2], [3, 1]),
([1, 3, 2], [1, 3, 2]),
([1, 3, 2], [2, 3, 1]),
([1, 3, 2], [2, 1, 1]),
([1, 3, 2], [1, 3, 1]),
([2, 1, 5], [2, 3, 1]),
([2,... | x=np.random.randint(0,2,np.prod(xs)).astype(np.bool).reshape(xs) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def test_local_reduce_join(self):
vx = matrix()
vy = matrix()
vz = matrix()
x = numpy.asarray([[1, 0], [3, 4]], dtype=config.floatX)
y = numpy.asarray([[4, 0], [2, 1]], dtype=config.floatX)
z = numpy.asarray([[5, 0], [1, 2]], dtype=config.floatX)
# Test differ... | def test_local_reduce_join(self):
vx = matrix()
vy = matrix()
vz = matrix()
x = numpy.asarray([[1, 0], [3, 4]], dtype=config.floatX)
y = numpy.asarray([[4, 0], [2, 1]], dtype=config.floatX)
z = numpy.asarray([[5, 0], [1, 2]], dtype=config.floatX)
# Test differ... | def test_local_reduce_join(self):
vx = matrix()
vy = matrix()
vz = matrix()
x = numpy.asarray([[1, 0], [3, 4]], dtype=config.floatX)
y = numpy.asarray([[4, 0], [2, 1]], dtype=config.floatX)
z = numpy.asarray([[5, 0], [1, 2]], dtype=config.floatX)
# Test differ... | (T.prod((vx,vy,vz),0),numpy.prod((x,y,z),0)), | {"_optimizer_stabilize":"gof.Query","_optimizer_specialize":"gof.Query","_optimizer_fast_run":"gof.Query"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_local_flatten_lift():
for i in xrange(1, 4):
x = tensor.tensor4()
out = tensor.flatten(T.exp(x), i)
assert out.ndim == i
mode = compile.mode.get_default_mode()
mode = mode.including('local_reshape_lift')
f = theano.function([x], out, mode=mode)
x_np =... | def test_local_flatten_lift():
for i in xrange(1, 4):
x = tensor.tensor4()
out = tensor.flatten(T.exp(x), i)
assert out.ndim == i
mode = compile.mode.get_default_mode()
mode = mode.including('local_reshape_lift')
f = theano.function([x], out, mode=mode)
x_np =... | def test_local_flatten_lift():
for i in xrange(1, 4):
x = tensor.tensor4()
out = tensor.flatten(T.exp(x), i)
assert out.ndim == i
mode = compile.mode.get_default_mode()
mode = mode.including('local_reshape_lift')
f = theano.function([x], out, mode=mode)
x_np =... | shape_out_np=tuple(x_np.shape[:i-1])+(numpy.prod(x_np.shape[i-1:]),) | {"_optimizer_stabilize":"gof.Query","_optimizer_specialize":"gof.Query","_optimizer_fast_run":"gof.Query"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def convert_to_linedrawing(self, luminous_image_data):
hist = exposure.histogram(luminous_image_data)[0]
hist = hist.reshape(numpy.prod(hist.shape))
n = len(hist)
value = numpy.arange(n, dtype=numpy.float)
# find best thresholds
t1 = 0
t2 = n
max_var... | def convert_to_linedrawing(self, luminous_image_data):
hist = exposure.histogram(luminous_image_data)[0]
| def convert_to_linedrawing(self, luminous_image_data):
hist = exposure.histogram(luminous_image_data)[0]
hist = hist.reshape(numpy. | hist=hist.reshape(numpy.prod(hist.shape)) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def remove_dup_initializers(onnx_file_path):
"""
Removes duplicate initializers from the model to reduce its size.
Writes a new file in the same directory as onnx_file_path and returns the path to that file.
"""
model_file_folder = os.path.dirname(onnx_file_path)
model_file_name = os.path.basen... | def remove_dup_initializers(onnx_file_path):
"""
Removes duplicate initializers from the model to reduce its size.
Writes a new file in the same directory as onnx_file_path and returns the path to that file.
"""
model_file_folder = os.path.dirname(onnx_file_path)
model_file_name = os.path.basen... | def remove_dup_initializers(onnx_file_path):
"""
Removes duplicate initializers from the model to reduce its size.
Writes a new file in the same directory as onnx_file_path and returns the path to that file.
"""
model_file_folder = os.path.dirname(onnx_file_path)
model_file_name = os.path.basen... | mem_size=numpy.prod(inits[j].dims) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_2x2dot2x2_reverse():
"""
C = A.dot(B) A,B are (2,2)-arrays
"""
A = array([[3.,1.],[2.,4.]])
Adot = array([[1.,0.],[0.,0.]])
B = array([[5.,2.],[1.,7.]])
Bdot = array([[0.,0.],[0.,0.]])
C = numpy.dot(A,B)
Cdot = numpy.dot(A,Bdot) + numpy.dot(Adot,B)
Cbar = array([[1.,0.],[0.,0.]])
cg = CGr... | def test_2x2dot2x2_reverse():
"""
C = A.dot(B) A,B are (2,2)-arrays
"""
A = array([[3.,1.],[2.,4.]])
Adot = array([[1.,0.],[0.,0.]])
B = array([[5.,2.],[1.,7.]])
Bdot = array([[0.,0.],[0.,0.]])
C = numpy.dot(A,B)
Cdot = numpy.dot(A,Bdot) + numpy.dot(Adot,B)
Cbar = array([[1.,0.],[0.,0.]])
cg = CGr... | def test_2x2dot2x2_reverse():
"""
C = A.dot(B) A,B are (2,2)-arrays
"""
A = array([[3.,1.],[2.,4.]])
Adot = array([[1.,0.],[0.,0.]])
B = array([[5.,2.],[1.,7.]])
Bdot = array([[0.,0.],[0.,0.]])
C = numpy.dot(A,B)
Cdot = numpy.dot(A,Bdot) + numpy.dot(Adot,B)
Cbar = array([[1.,0.],[0.,0.]])
cg = CGr... | assertnumpy.prod(C==FC.x.X) | {"cg":"CGraph","FA":"Function","FB":"Function"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_matrix_assembly_2x2():
"""
C = [[A,B],[B,A]]
A,B are (2,2)-arrays
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
B = array([[3.,3.],[3.,3.]])
Bdot = array([[4.,4.],[4.,4.]])
C = zeros((4,4))
C[:2,:2] = A
C[:2,2:] = B
C[2:,:2] = B
C[2:,2:] = A
Cdot = zeros((4,4))
Cdot[:2... | def test_matrix_assembly_2x2():
"""
C = [[A,B],[B,A]]
A,B are (2,2)-arrays
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
B = array([[3.,3.],[3.,3.]])
Bdot = array([[4.,4.],[4.,4.]])
C = zeros((4,4))
C[:2,:2] = A
C[:2,2:] = B
C[2:,:2] = B
C[2:,2:] = A
Cdot = zeros((4,4))
Cdot[:2... | def test_matrix_assembly_2x2():
"""
C = [[A,B],[B,A]]
A,B are (2,2)-arrays
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
B = array([[3.,3.],[3.,3.]])
Bdot = array([[4.,4.],[4.,4.]])
C = zeros((4,4))
C[:2,:2] = A
C[:2,2:] = B
C[2:,:2] = B
C[2:,2:] = A
Cdot = zeros((4,4))
Cdot[:2... | assertnumpy.prod(FC.x.X==C) | {"cg":"CGraph","FA":"Function","FB":"Function","FC":"Function"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def test_trace_2x2():
"""
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
trbar = array([[13.]])
trbardot = array([[0.]])
cg = CGraph()
FA = Function(Mtc(A,Adot))
Ftr = trace(FA)
cg.independentFunctionList = [FA]
cg.dependentFunctionList = [Ftr]
cg.reverse([Mtc(trbar,trbardot)])
ass... | def test_trace_2x2():
"""
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
trbar = array([[13.]])
trbardot = array([[0.]])
cg = CGraph()
FA = Function(Mtc(A,Adot))
Ftr = trace(FA)
cg.independentFunctionList = [FA]
cg.dependentFunctionList = [Ftr]
cg.reverse([Mtc(trbar,trbardot)])
| def test_trace_2x2():
"""
"""
A = array([[1.,1.],[1.,1.]])
Adot = array([[2.,2.],[2.,2.]])
trbar = array([[13.]])
trbardot = array([[0.]])
cg = CGraph()
FA = Function(Mtc(A,Adot))
Ftr = trace(FA)
cg.independentFunctionList = [FA]
cg.dependentFunctionList = [Ftr]
cg.reverse([Mtc(trbar,trbardot)])
ass... | assertnumpy.prod(FA.xbar.X==array([[13.,0.],[0.,13.]])) | {"cg":"CGraph","FA":"Function"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def _normalize_add_shape(self, x, attr="data_shape"):
"""
Flattens input data to 2d.
"""
if not torch.is_tensor(x):
x = torch.tensor(x)
if len(x.shape) < 1:
x = x.view(-1)
data_shape = getattr(self, attr, None)
if data_shape is None:
... | def _normalize_add_shape(self, x, attr="data_shape"):
"""
Flattens input data to 2d.
"""
if not torch.is_tensor(x):
x = torch.tensor(x)
if len(x.shape) < 1:
x = x.view(-1)
data_shape = getattr(self, attr, None)
if data_shape is None:
... | def _normalize_add_shape(self, x, attr="data_shape"):
"""
Flattens input data to 2d.
"""
if not torch.is_tensor(x):
x = torch.tensor(x)
if len(x.shape) < 1:
x = x.view(-1)
data_shape = getattr(self, attr, None)
if data_shape is None:
... | returnx.view(x.shape[0],int(numpy.prod(data_shape))) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def add(self, data, index=None):
"""
Adds a batch of data to be considered for the running top k.
The zeroth dimension enumerates the observations. All other
dimensions enumerate different features.
"""
if self.top_data is None:
# Allocation: allocate a b... | def add(self, data, index=None):
"""
Adds a batch of data to be considered for the running top k.
The zeroth dimension enumerates the observations. All other
dimensions enumerate different features.
"""
if self.top_data is None:
# Allocation: allocate a b... | def add(self, data, index=None):
"""
Adds a batch of data to be considered for the running top k.
The zeroth dimension enumerates the observations. All other
dimensions enumerate different features.
"""
if self.top_data is None:
# Allocation: allocate a b... | feature_size=int(numpy.prod(self.data_shape)) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def vector_norm(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False, ord: Optional[Union[int, float]] = 2) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.
See its docstring for more information.
"""
# Note: the res... | def vector_norm(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False, ord: Optional[Union[int, float]] = 2) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.
See its docstring for more information.
"""
# Note: the res... | def vector_norm(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False, ord: Optional[Union[int, float]] = 2) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.
See its docstring for more information.
"""
# Note: the res... | (np.prod([a.shape[i]foriinaxis],dtype=int),*[a.shape[i]foriinrest])) | {} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
up-to-dated | sourcegraph | def project_sphere(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: variable or tensor
:type array: torch.autograd.Variable or torch.... | def project_sphere(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: variable or tensor
:type array: torch.autograd.Variable or torch.... | def project_sphere(array, epsilon=1, ord=2):
"""
Compute the orthogonal projection of the input tensor (as vector) onto the L_ord epsilon-ball.
**Assumes the first dimension to be batch dimension, which is preserved.**
:param array: variable or tensor
:type array: torch.autograd.Variable or torch.... | flattened_size=numpy.prod(numpy.array(size[1:])) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def t_binomial(mean, size, const_size, var_input, input, steps, rtol):
R = MRG_RandomStreams(234, use_cuda=False)
u = R.binomial(size=size, p=mean)
f = theano.function(var_input, u, mode=mode)
out = f(*input)
# Increase the number of steps if sizes implies only a few samples
if numpy.prod(const... | def t_binomial(mean, size, const_size, var_input, input, steps, rtol):
R = MRG_RandomStreams(234, use_cuda=False)
u = R.binomial(size=size, p=mean)
f = theano.function(var_input, u, mode=mode)
out = f(*input)
# Increase the number of steps if sizes implies only a few samples
| def t_binomial(mean, size, const_size, var_input, input, steps, rtol):
R = MRG_RandomStreams(234, use_cuda=False)
u = R.binomial(size=size, p=mean)
f = theano.function(var_input, u, mode=mode)
out = f(*input)
# Increase the number of steps if sizes implies only a few samples
if numpy. | ifnumpy.prod(const_size)<10: | {"R":"MRG_RandomStreams","RR":"theano.tensor.shared_randomstreams.RandomStreams"} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def stack_images(images):
images_shape = numpy.array(images.shape)
new_axes = get_transpose_axes(len(images_shape))
new_shape = [numpy.prod(images_shape[x]) for x in new_axes]
return numpy.transpose(
images,
axes=numpy.concatenate(new_axes)
).reshape(new_shape) | def stack_images(images):
images_shape = numpy.array(images.shape)
new_axes = get_transpose_axes(len(images_shape))
| def stack_images(images):
images_shape = numpy.array(images.shape)
new_axes = get_transpose_axes(len(images_shape))
new_shape = [numpy. | new_shape=[numpy.prod(images_shape[x])forxinnew_axes] | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def sigmasq(self, outer_shape):
size = numpy.prod(outer_shape)
tmp = numpy.diag(self.grad @ self.cov @ self.grad.T)
out = pyobs.double_array((size,), zeros=True)
for a in self.mask:
ia = self.mask.index(a)
out[a] = tmp[ia]
return numpy.reshape(out, out... | def sigmasq(self, outer_shape):
| def sigmasq(self, outer_shape):
size = numpy. | size=numpy.prod(outer_shape) | {} | {"numpy.cumprod":"numpy.cumprod","numpy.all":"numpy.all","numpy.round_":"numpy.round_","numpy.prod":"numpy.prod","numpy.sometrue":"numpy.sometrue","numpy.cumproduct":"numpy.cumproduct","numpy.any":"numpy.any","numpy.product":"numpy.product","numpy.round":"numpy.round","numpy.alltrue":"numpy.alltrue","numpy.sort":"numpy... | [
"numpy.product"
] | numpy.prod | numpy.prod |
up-to-dated | sourcegraph | def style_gram_symbol(input_shape, style):
_, output_shapes, _ = style.infer_shape(**input_shape)
gram_list = []
grad_scale = []
for i in range(len(style.list_outputs())):
shape = output_shapes[i]
x = mx.sym.Reshape(style[i], shape=(int(shape[1]), int(np.prod(shape[2:]))))
# use ... | def style_gram_symbol(input_shape, style):
_, output_shapes, _ = style.infer_shape(**input_shape)
gram_list = []
grad_scale = []
for i in range(len(style.list_outputs())):
shape = output_shapes[i]
x = mx.sym.Reshape(style[i], shape=(int(shape[1]), int(np.prod(shape[2:]))))
# use ... | def style_gram_symbol(input_shape, style):
_, output_shapes, _ = style.infer_shape(**input_shape)
gram_list = []
grad_scale = []
for i in range(len(style.list_outputs())):
shape = output_shapes[i]
x = mx.sym.Reshape(style[i], shape=(int(shape[1]), int(np.prod(shape[2:]))))
# use ... | grad_scale.append(np.prod(shape[1:])*shape[1]) | {"x":"mx.sym.Reshape","gram":"mx.sym.FullyConnected"} | {"np.cumprod":"numpy.cumprod","np.all":"numpy.all","np.round_":"numpy.round_","np.prod":"numpy.prod","np.sometrue":"numpy.sometrue","np.cumproduct":"numpy.cumproduct","np.any":"numpy.any","np.product":"numpy.product","np.round":"numpy.round","np.alltrue":"numpy.alltrue","np.sort":"numpy.sort","np.msort":"numpy.msort"} | [
"numpy.product"
] | numpy.prod | np.prod |
End of preview.
Deprecated-API Code Generation Benchmark
Python functions mined from open-source repositories, each anchored on a library API that has since been deprecated or replaced. Used to test whether a code LLM still emits the outdated API, and to build forget / test splits per model.
Structure
outdated_all.json # O — samples calling the deprecated API
uptodated_all.json # U — samples calling the replacement API
<model>/ # codegen | codellama | deepseek | starcoder
├── updated_dep.json # samples of U where this model still emits the OLD API
├── D_forget.json # O + half of updated_dep
├── D_test.json # U minus that same half
├── D_test_U_dep.json # part of D_test that is in updated_dep
└── D_test_U_nondep.json # the rest of D_test
O and U are disjoint. updated_dep.json is model-specific and is a subset of
U: half of it goes into D_forget, the other half stays in D_test and is
exactly D_test_U_dep. So D_forget ∩ D_test = ∅ and
D_test_U_dep + D_test_U_nondep = D_test.
Counts
| records | |
|---|---|
outdated_all.json (O) |
9,087 |
uptodated_all.json (U) |
18,340 |
| Model | updated_dep |
D_forget |
D_test |
D_test_U_dep |
D_test_U_nondep |
|---|---|---|---|---|---|
| codegen | 3,314 | 10,744 | 16,683 | 1,657 | 15,026 |
| codellama | 2,619 | 10,396 | 17,031 | 1,310 | 15,721 |
| deepseek | 1,161 | 9,667 | 17,760 | 581 | 17,179 |
| starcoder | 2,963 | 10,568 | 16,859 | 1,482 | 15,377 |
- Downloads last month
- 176