function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def _pyro_noncentered_model(J, sigma, y=None):
import pyro
import pyro.distributions as dist | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def pyro_noncentered_schools(data, draws, chains):
"""Non-centered eight schools implementation in Pyro."""
import torch
from pyro.infer import MCMC, NUTS | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def _numpyro_noncentered_model(J, sigma, y=None):
import numpyro
import numpyro.distributions as dist | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def numpyro_schools_model(data, draws, chains):
"""Centered eight schools implementation in NumPyro."""
from jax.random import PRNGKey
from numpyro.infer import MCMC, NUTS | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def pystan_noncentered_schools(data, draws, chains):
"""Non-centered eight schools implementation for pystan."""
schools_code = """
data {
int<lower=0> J;
real y[J];
real<lower=0> sigma[J];
} | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def pymc3_noncentered_schools(data, draws, chains):
"""Non-centered eight schools implementation for pymc3."""
import pymc3 as pm | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def library_handle(library):
"""Import a library and return the handle."""
if library == "pystan":
try:
module = importlib.import_module("pystan")
except ImportError:
module = importlib.import_module("stan")
else:
module = importlib.import_module(libra... | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def load_cached_models(eight_schools_data, draws, chains, libs=None):
"""Load pymc3, pystan, emcee, and pyro models from pickle."""
here = os.path.dirname(os.path.abspath(__file__))
supported = (
("pystan", pystan_noncentered_schools),
("pymc3", pymc3_noncentered_schools),
("em... | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def pystan_version():
"""Check PyStan version. | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def test_precompile_models(eight_schools_params, draws, chains):
"""Precompile model files."""
load_cached_models(eight_schools_params, draws, chains) | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def running_on_ci() -> bool:
"""Return True if running on CI machine."""
return os.environ.get("ARVIZ_CI_MACHINE") is not None | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def importorskip(
modname: str, minversion: Optional[str] = None, reason: Optional[str] = None | arviz-devs/arviz | [
1351,
324,
1351,
165,
1438170670
] |
def minPathSum(self, grid: List[List[int]]) -> int:
row = len(grid)
col = len(grid[0])
dp = [[0]*col for i in range(row)]
minPath = 0
return self.findPath(grid, row-1, col-1, dp) | saisankargochhayat/algo_quest | [
2,
1,
2,
1,
1473454289
] |
def process_nbest(fread, fwrite):
nEmptySentNum = 0
with open(fread, 'rt') as f1, open(fwrite, 'wt') as f2:
for a in [line.split() for line in f1]:
if len(a) == 1:
nEmptySentNum += 1
a.append('<UNK>')
f2.write(' '.join(a) + '\n')
print('[nbest]... | wbengine/SPMILM | [
18,
10,
18,
1,
1470972882
] |
def __init__(self,
x_dim: float,
y_dim: float,
tunneling: float,
coulomb: float,
periodic: bool=True,
iterations: int=1,
adiabatic_evolution_time: Optional[float]=None,
qubits: Optiona... | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def param_bounds(self) -> Optional[Sequence[Tuple[float, float]]]:
"""Bounds on the parameters."""
bounds = []
for param in self.params():
s = 1.0 if param.letter == 'V' else 2.0
bounds.append((-s, s))
return bounds | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def operations(self, qubits: Sequence[cirq.Qid]) -> cirq.OP_TREE:
"""Produce the operations of the ansatz circuit."""
for i in range(self.iterations):
# Apply one- and two-body interactions with a swap network that
# reverses the order of the modes
def one_and_two_b... | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def _is_horizontal_edge(p, q, x_dim, y_dim, periodic):
n_sites = x_dim*y_dim
if p < n_sites and q >= n_sites or q < n_sites and p >= n_sites:
return False
if p >= n_sites and q >= n_sites:
p -= n_sites
q -= n_sites
return (q == _right_neighbor(p, x_dim, y_dim, periodic)
... | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def _are_same_site_opposite_spin(p, q, n_sites):
return abs(p-q) == n_sites | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def _bottom_neighbor(site, x_dimension, y_dimension, periodic):
if y_dimension == 1:
return None
if site + x_dimension + 1 > x_dimension*y_dimension:
if periodic:
return site + x_dimension - x_dimension*y_dimension
else:
return None
return site + x_dimension | quantumlib/OpenFermion-Cirq | [
265,
89,
265,
31,
1521507533
] |
def setUp(self):
super().setUp()
self._connection_config = metadata_store_pb2.ConnectionConfig()
self._connection_config.sqlite.SetInParent()
self._metadata = self.enter_context(
metadata.Metadata(connection_config=self._connection_config))
self._store = self._metadata.store | tensorflow/tfx | [
1905,
649,
1905,
157,
1549300476
] |
def testStrategy(self):
# Model with id 1, will be blessed.
model_one = standard_artifacts.Model()
model_one.uri = 'model_one'
model_one.id = 1
# Model with id 2, will be blessed.
model_two = standard_artifacts.Model()
model_two.uri = 'model_two'
model_two.id = 2
# Model with id 3, w... | tensorflow/tfx | [
1905,
649,
1905,
157,
1549300476
] |
def format_raw(self, location, indent="", embedded=True,
indirect_attrs=True):
details = [indent + "{0:c}: {0.name}".format(location)]
if location.fullname:
details.append(indent + " Fullname: {}".format(location.fullname))
if hasattr(location, 'timezone'):
... | quattor/aquilon | [
12,
16,
12,
38,
1361797498
] |
def csv_fields(self, location):
"""Yield a CSV-ready list of selected attribute values for location."""
# Columns 0 and 1
details = [location.location_type, location.name]
# Columns 2 and 3
if location.parent:
details.append(location.parent.location_type)
... | quattor/aquilon | [
12,
16,
12,
38,
1361797498
] |
def on_init(self):
pass | scionrep/scioncc | [
3,
10,
3,
1,
1435685091
] |
def on_quit(self):
pass | scionrep/scioncc | [
3,
10,
3,
1,
1435685091
] |
def extractNotsogoodtranslatorWordpressCom(item):
'''
Parser for 'notsogoodtranslator.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'tran... | fake-name/ReadableWebProxy | [
191,
16,
191,
3,
1437712243
] |
def extractDhragonisslytherinWordpressCom(item):
'''
Parser for 'dhragonisslytherin.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'transl... | fake-name/ReadableWebProxy | [
191,
16,
191,
3,
1437712243
] |
def session_type():
if 'IPython' not in sys.modules:
# IPython hasn't been imported, definitely not
return "python"
from IPython import get_ipython
# check for `kernel` attribute on the IPython instance
if getattr(get_ipython(), 'kernel', None) is not None:
return "kernel"
re... | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def get_relationship_variable_id(path):
_, r = path[0]
child_link_name = r.child_variable.id
for _, r in path[1:]:
parent_link_name = child_link_name
child_link_name = '%s.%s' % (r.parent_entity.id,
parent_link_name)
return child_link_name | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def check_schema_version(cls, cls_type):
if isinstance(cls_type, str):
if cls_type == 'entityset':
from featuretools.entityset.serialize import SCHEMA_VERSION
version_string = cls.get('schema_version')
elif cls_type == 'features':
from featuretools.feature_base.fe... | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def use_s3fs_es(file_path, path, read=True):
s3 = s3fs.S3FileSystem(anon=True)
if read:
s3.get(path, file_path)
else:
s3.put(file_path, path) | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def __init__(self, num_filters, filter_length, **kwargs):
self.num_filters = num_filters
self.filter_length = filter_length
super(Conv1D, self).__init__(**kwargs) | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def _initialize(self):
self.weights_init.initialize(self.parameters[0], self.rng) | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def __init__(self, match_dim, conv_n, conv_num_filters=1,
state_transformer=None,
attended_transformer=None, energy_computer=None,
prior=None, energy_normalizer=None, **kwargs):
super(SequenceContentAndConvAttention, self).__init__(**kwargs)
if not stat... | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def compute_energies(self, attended, preprocessed_attended,
previous_weights, states):
if not preprocessed_attended:
preprocessed_attended = self.preprocess(attended)
transformed_states = self.state_transformers.apply(as_dict=True,
... | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def mask_row(offset, length, empty_row):
return tensor.set_subtensor(empty_row[offset:offset+length], 1) | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def take_glimpses(self, attended, preprocessed_attended=None,
attended_mask=None, weights=None, step=None, **states):
# Cut the considered window.
p = self.prior
length = attended.shape[0]
prior_type = p.get('type', 'expanding')
if prior_type=='expanding':
... | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def take_glimpses_inputs(self):
return (['attended', 'preprocessed_attended',
'attended_mask', 'weights', 'step'] +
self.state_names) | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def compute_weights(self, energies, attended_mask):
if self.energy_normalizer == 'softmax':
logger.debug("Using softmax attention weights normalization")
energies = energies - energies.max(axis=0)
unnormalized_weights = tensor.exp(energies)
elif self.energy_normalizer... | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def initial_glimpses(self, batch_size, attended):
return ([tensor.zeros((batch_size, self.attended_dim))]
+ 2 * [tensor.concatenate([
tensor.ones((batch_size, 1)),
tensor.zeros((batch_size, attended.shape[0] - 1))],
axis=1)]
... | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def initial_glimpses_outputs(self):
return ['weight_averages', 'weights', 'energies', 'step'] | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def preprocess(self, attended):
return self.attended_transformer.apply(attended) | rizar/attention-lvcsr | [
259,
103,
259,
11,
1443211188
] |
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def color(self, val):
self["color"] = val | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def family(self, val):
self["family"] = val | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def size(self, val):
self["size"] = val | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def _prop_descriptions(self):
return """\
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple ... | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/food/shared_drink_aludium_pu36.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/event_perk/shared_fire_pit_deed.iff"
result.attribute_template_id = 2
result.stfName("event_perk","fire_pit_name") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def from_election_to_elections(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
Election = apps.get_model("elections", "Election")
Candidate = apps.get_model("elections", "Candidate")
for cand... | ciudadanointeligente/votainteligente-portal-electoral | [
43,
34,
43,
122,
1375904659
] |
def addTemplate(core):
mobileTemplate = MobileTemplate() | ProjectSWGCore/NGECore2 | [
23,
70,
23,
56,
1372673790
] |
def InfSourceParser(self, SectionString, InfSectionObject, FileName):
SectionMacros = {}
ValueList = []
SourceList = []
StillCommentFalg = False
HeaderComments = []
LineComment = None
SectionContent = ''
for Line in SectionString:... | google/google-ctf | [
3196,
457,
3196,
1,
1524844563
] |
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize google options flow."""
self.config_entry = config_entry | home-assistant/home-assistant | [
58698,
22318,
58698,
2794,
1379402988
] |
def async_get_options_flow(
config_entry: config_entries.ConfigEntry, | home-assistant/home-assistant | [
58698,
22318,
58698,
2794,
1379402988
] |
def ControllerAgentClockSync(issue_ts, name):
"""Record the clock sync marker for controller tracing agent.
Unlike with the other tracing agents, the tracing controller should not
call this directly. Rather, it is called via callback from the other
tracing agents when they write a trace.
"""
trace_event.cl... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def __init__(self):
# TODO(https://crbug.com/1262296): Update this after Python2 trybots retire.
# pylint: disable=super-with-arguments
super(TracingControllerAgent, self).__init__()
self._log_path = None | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def StartAgentTracing(self, config, timeout=None):
"""Start tracing for the controller tracing agent.
Start tracing for the controller tracing agent. Note that
the tracing controller records the "controller side"
of the clock sync records, and nothing else.
"""
del config
if not trace_event... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def StopAgentTracing(self, timeout=None):
"""Stops tracing for the controller tracing agent.
"""
# pylint: disable=no-self-use
# This function doesn't use self, but making it a member function
# for consistency with the other TracingAgents
trace_event.trace_disable()
return True | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def GetResults(self, timeout=None):
"""Gets the log output from the controller tracing agent.
This output only contains the "controller side" of the clock sync records.
"""
with open(self._log_path, 'r') as outfile:
data = ast.literal_eval(outfile.read() + ']')
# Explicitly set its own clock ... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def RecordClockSyncMarker(self, sync_id, callback):
raise NotImplementedError | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def __init__(self, agents_with_config, controller_config):
"""Create tracing controller.
Create a tracing controller object. Note that the tracing
controller is also a tracing agent.
Args:
agents_with_config: List of tracing agents for this controller with the
corresp... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def get_child_agents(self):
return self._child_agents | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def StopTracing(self):
"""Issue clock sync marker and stop tracing for all tracing agents.
This function stops both the controller tracing agent
and the child tracing agents. It issues a clock sync marker prior
to stopping tracing.
Returns:
Boolean indicating whether or not the stop tracin... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def _IssueClockSyncMarker(self):
"""Issue clock sync markers to all the child tracing agents."""
for agent in self._child_agents:
if agent.SupportsExplicitClockSync():
sync_id = GetUniqueSyncID()
agent.RecordClockSyncMarker(sync_id, ControllerAgentClockSync) | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def __init__(self, agent, config):
self.agent = agent
self.config = config | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def __init__(self, output_file, trace_time, write_json,
link_assets, asset_dir, timeout, collection_timeout,
device_serial_number, target, trace_buf_size):
tracing_agents.TracingConfig.__init__(self)
self.output_file = output_file
self.trace_time = trace_time
self.write_jso... | catapult-project/catapult | [
1835,
570,
1835,
1039,
1429033745
] |
def get_challenge_for_url(url):
""" Gets the challenge for the cached URL.
:param url: the URL the challenge is cached for.
:rtype: HttpBearerChallenge """
if not url:
raise ValueError("URL cannot be None")
key = _get_cache_key(url)
with _lock:
return _cache.get(key) | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def remove_challenge_for_url(url):
""" Removes the cached challenge for the specified URL.
:param url: the URL for which to remove the cached challenge """
if not url:
raise ValueError("URL cannot be empty")
url = parse.urlparse(url)
with _lock:
del _cache[url.netloc] | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def status(self) -> str:
return "NonClosingPool" | timabbott/zulip | [
2,
7,
2,
1,
1443209656
] |
def recreate(self) -> 'NonClosingPool':
return self.__class__(creator=self._creator,
recycle=self._recycle,
use_threadlocal=self._use_threadlocal,
reset_on_return=self._reset_on_return,
echo=s... | timabbott/zulip | [
2,
7,
2,
1,
1443209656
] |
def make_image():
img = np.zeros((500, 500), np.uint8)
black, white = 0, 255
for i in xrange(6):
dx = int((i%2)*250 - 30)
dy = int((i/2.)*150)
if i == 0:
for j in xrange(11):
angle = (j+5)*np.pi/21
c, s = np.cos(angle), np.sin(angle)
... | makelove/OpenCV-Python-Tutorial | [
2997,
1086,
2997,
11,
1445060268
] |
def update(levels):
vis = np.zeros((h, w, 3), np.uint8)
levels = levels - 3
cv2.drawContours( vis, contours, (-1, 2)[levels <= 0], (128,255,255),
3, cv2.LINE_AA, hierarchy, abs(levels) )
cv2.imshow('contours', vis) | makelove/OpenCV-Python-Tutorial | [
2997,
1086,
2997,
11,
1445060268
] |
def setUp(self):
super(DebugIdentityV2OpTest, self).setUp()
# Testing using a small circular-buffer size.
self.circular_buffer_size = 4
self.tfdbg_run_id = "test_tfdbg_run"
self.writer = debug_events_writer.DebugEventsWriter(
self.dump_root, self.tfdbg_run_id, self.circular_buffer_size) | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testSingleTensorFullTensorDebugModeWithCircularBufferBehavior(self):
@def_function.function
def write_debug_trace(x):
square = math_ops.square(x)
gen_debug_ops.debug_identity_v2(
square,
tfdbg_context_id="deadbeaf",
op_name="Square",
output_slot=0,
... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testControlFlow(self):
@def_function.function
def collatz(x):
counter = constant_op.constant(0, dtype=dtypes.int32)
while math_ops.greater(x, 1):
counter = counter + 1
gen_debug_ops.debug_identity_v2(
x,
tfdbg_context_id="deadbeaf",
op_name="x... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testTwoDumpRoots(self):
another_dump_root = os.path.join(self.dump_root, "another")
another_debug_url = "file://%s" % another_dump_root
another_writer = debug_events_writer.DebugEventsWriter(
another_dump_root, "test_tfdbg_run")
@def_function.function
def write_debug_trace(x):
# D... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testInvokingDebugIdentityV2OpBeforeCreatingDebugEventsWriterWorks(self):
circular_buffer_size = 3
@def_function.function
def write_debug_trace(x):
# DebugIdentityV2 is a stateful op. It ought to be included by auto
# control dependency.
square = math_ops.square(x)
gen_debug_ops.... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpReduceInfNanThreeSlots(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(
debug_event_pb2.TensorDebugMode.REDUCE_INF_NAN_THREE_SLOTS)))
self.assertAllEqua... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpLargeTensorIDError(self):
modes = [
debug_event_pb2.TensorDebugMode.CURT_HEALTH,
debug_event_pb2.TensorDebugMode.CONCISE_HEALTH,
debug_event_pb2.TensorDebugMode.SHAPE,
]
# Maximum allowed tensor_id
tensor_id = np.power(2, 53, dtype=np.int64)
for... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpCurtHealthValuesSmall(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.CURT_HEALTH),
tensor_id=x._id,
output_dtype=d... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpCurtHealthValuesLarge(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.CURT_HEALTH),
tensor_id=x._id,
output_dtype=d... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpCurtHealthConsistency(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.CURT_HEALTH),
tensor_id=x._id,
output_dtype=d... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpDeterminism(self):
x = np.zeros([100, 100, 50], dtype=np.float64)
x = constant_op.constant(x)
modes = (
debug_event_pb2.TensorDebugMode.CONCISE_HEALTH,
debug_event_pb2.TensorDebugMode.FULL_HEALTH,
)
for mode in modes:
debug_mode = debug_event_... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpConciseHealthSmall(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(
debug_event_pb2.TensorDebugMode.CONCISE_HEALTH),
tensor_id=x._id,
... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpConciseHealthLarge(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(
debug_event_pb2.TensorDebugMode.CONCISE_HEALTH),
tensor_id=x._id,
... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpConciseHealthConsistency(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(
debug_event_pb2.TensorDebugMode.CONCISE_HEALTH),
tensor_id=x._id,
... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpShapeEmpty(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.SHAPE),
tensor_id=x._id,
output_dtype=dtypes.float64)), ... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpShapeSmall(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.SHAPE),
tensor_id=x._id,
output_dtype=dtypes.float64)), ... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpShapeLarge(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.SHAPE),
tensor_id=x._id,
output_dtype=dtypes.float64)), ... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpFullHealthSmall(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.FULL_HEALTH),
tensor_id=x._id,
output_dtype=dtypes.... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpFullHealthLarge(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.FULL_HEALTH),
tensor_id=x._id,
output_dtype=dtypes.... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testDebugNumericSummaryV2OpFullHealthConsistency(self):
def debug_summary(x):
return self.evaluate(
gen_debug_ops.debug_numeric_summary_v2(
x,
tensor_debug_mode=(debug_event_pb2.TensorDebugMode.FULL_HEALTH),
tensor_id=x._id,
output_dtype=d... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def testCheckNumericsV2OpNegativeAndPositiveInfAndNaN(self):
"""CheckNumericsV2 op distinguishes - & + infs when nan is present."""
with self.session(graph=ops.Graph()):
t1 = constant_op.constant([-1.0, 1.0, 0.0])
t2 = constant_op.constant([0.0, 0.0, 0.0])
with self.assertRaisesRegex(
... | tensorflow/tensorflow | [
171949,
87931,
171949,
2300,
1446859160
] |
def test(self):
print "I##|nitializing A", "test"##|
attribute = "hello" | aptana/Pydev | [
239,
85,
239,
6,
1250792405
] |
def my_method(self):
print self.attribute | aptana/Pydev | [
239,
85,
239,
6,
1250792405
] |
def _get_context(req):
return req.environ['nova.context'] | ntt-sic/nova | [
1,
2,
1,
1,
1382427064
] |
def wrapped(self, req, id, body, *args, **kwargs):
if len(body) == 1 and "host" in body:
host = body['host']
else:
raise exc.HTTPBadRequest()
return fn(self, req, id, host, *args, **kwargs) | ntt-sic/nova | [
1,
2,
1,
1,
1382427064
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.