id stringlengths 15 25 | source stringclasses 1
value | chunk_index int64 0 393k | token_count int32 449 512 | text stringlengths 203 7.95k |
|---|---|---|---|---|
combine_chunk_392000 | combine.txt | 392,000 | 512 | ;
})
.on("drag", function(d) {
d.fx = d3.event.x; d.fy = d3.event.y;
})
.on("end", function(d) {
if (!d3.event.active) simulation.alphaTarget(0);
d.fx = d.fy = null;
}));
// Within the group, draw... |
combine_chunk_392001 | combine.txt | 392,001 | 512 | (.5, y1, y2)
+ " " + x2 + " " + y2
return s;
});
}
buildGraph()
</script>
"""
def TensorTypeToName(tensor_type):
"""Converts a numerical enum to a readable tensor type."""
for name, value in schema_fb.TensorType.__dict__.items():
if value == tensor_type:
return name
return ... |
combine_chunk_392002 | combine.txt | 392,002 | 512 | (tensor["name"]) + " "
html += TensorTypeToName(tensor["type"]) + " "
html += (repr(tensor["shape"]) if "shape" in tensor else "[]")
html += (repr(tensor["shape_signature"])
if "shape_signature" in tensor else "[]") + "<br>"
html += "</span>"
html += repr(x)
html += "</span>... |
combine_chunk_392003 | combine.txt | 392,003 | 512 | .5 + 1) * pixel_mult,
(tensor_output_position + 1) * width_mult)
edges.append({
"target": TensorName(tensor_index),
"source": OpName(op_index)
})
nodes.append({
"id": OpName(op_index),
"name": opcode_mapper(op["opcode_index"]... |
combine_chunk_392004 | combine.txt | 392,004 | 512 | .keys()
for h, mapper in keys_to_print:
val = tensor[h] if h in tensor else None
val = val if mapper is None else mapper(val)
html += "<td><div class='cell-content'>%s</div></td>\n" % val
html += "</tr>\n"
html += "</table>\n"
return html
def CamelCaseToSnakeCase(camel_case_input):
""... |
combine_chunk_392005 | combine.txt | 392,005 | 512 | _filepath=True): # pylint: disable=invalid-name
"""Returns html description with the given tflite model.
Args:
tflite_input: TFLite flatbuffer model path or model object.
input_is_filepath: Tells if tflite_input is a model path or a model object.
Returns:
Dump of the given tflite model in HTML form... |
combine_chunk_392006 | combine.txt | 392,006 | 512 | "], d["deprecated_builtin_code"])
for subgraph_idx, g in enumerate(data["subgraphs"]):
# Subgraph local specs on what to display
html += "<div class='subgraph'>"
tensor_mapper = TensorMapper(g)
opcode_mapper = OpCodeMapper(data)
op_keys_to_display = [("inputs", tensor_mapper), ("outputs", tensor_... |
combine_chunk_392007 | combine.txt | 392,007 | 512 | :
html = create_html(tflite_input)
with open(html_output, "w") as output_file:
output_file.write(html)
if __name__ == "__main__":
main(sys.argv)
<|file|>tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under t... |
combine_chunk_392008 | combine.txt | 392,008 | 512 | _def.
Returns:
dict containing serving names to SignatureDefs if exists, otherwise, empty
dict.
Raises:
ValueError:
tflite_model buffer does not contain a valid TFLite model.
DecodeError:
SignatureDef cannot be parsed from TfLite SignatureDef metadata.
"""
model = tflite_model
... |
combine_chunk_392009 | combine.txt | 392,009 | 512 | tensorflow/tensorflow/lite/tools/convert_image_to_csv.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... |
combine_chunk_392010 | combine.txt | 392,010 | 512 | image_ops.decode_image(file_data, channels=channels).eval()
resized_tensor = image_ops.resize_images_v2(image_tensor,
(height, width)).eval()
return resized_tensor
def array_to_int_csv(array_data):
"""Converts all elements in a numerical array to a comma-se... |
combine_chunk_392011 | combine.txt | 392,011 | 512 | )
builder.PrependUint8(7)
builder.PrependUint8(6)
builder.PrependUint8(5)
builder.PrependUint8(4)
builder.PrependUint8(3)
builder.PrependUint8(2)
builder.PrependUint8(1)
builder.PrependUint8(0)
buffer1_data_offset = builder.EndVector()
schema_fb.BufferStart(builder)
schema_fb.BufferAddData(builder... |
combine_chunk_392012 | combine.txt | 392,012 | 512 | builder.PrependFloat32(5.0)
builder.PrependFloat32(6.0)
builder.PrependFloat32(7.0)
quant1_scale_offset = builder.EndVector()
schema_fb.QuantizationParametersStartZeroPointVector(builder, 5)
builder.PrependInt64(1)
builder.PrependInt64(2)
builder.PrependInt64(3)
builder.PrependInt64(-1)
builder.Pre... |
combine_chunk_392013 | combine.txt | 392,013 | 512 | _offset)
builder.PrependUOffsetTRelative(tensor0_offset)
tensors_offset = builder.EndVector()
schema_fb.SubGraphStartInputsVector(builder, 1)
builder.PrependInt32(0)
inputs_offset = builder.EndVector()
schema_fb.SubGraphStartOutputsVector(builder, 1)
builder.PrependInt32(2)
outputs_offset = builder.En... |
combine_chunk_392014 | combine.txt | 392,014 | 512 | schema_fb.OperatorEnd(builder)
schema_fb.OperatorStart(builder)
schema_fb.OperatorAddBuiltinOptionsType(
builder, schema_fb.BuiltinOptions.VarHandleOptions)
schema_fb.OperatorAddBuiltinOptions(builder, var_handle_options_offset)
op2_offset = schema_fb.OperatorEnd(builder)
schema_fb.SubGraphStartOpera... |
combine_chunk_392015 | combine.txt | 392,015 | 512 | _fb.SignatureDefEnd(builder)
schema_fb.ModelStartSignatureDefsVector(builder, 1)
builder.PrependUOffsetTRelative(signature_offset)
signature_defs_offset = builder.EndVector()
string4_offset = builder.CreateString('model_description')
schema_fb.ModelStart(builder)
schema_fb.ModelAddVersion(builder, TFLITE_S... |
combine_chunk_392016 | combine.txt | 392,016 | 512 | to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================... |
combine_chunk_392017 | combine.txt | 392,017 | 512 | _microfrontend_op = load_library.load_op_library(
resource_loader.get_path_to_datafile("_audio_microfrontend_op.so"))
def audio_microfrontend(audio,
sample_rate=16000,
window_size=25,
window_step=10,
num_channels=32,
... |
combine_chunk_392018 | combine.txt | 392,018 | 512 | gain.
enable_log: Bool, enable logarithmic scaling of filterbanks.
scale_shift: Integer, scale filterbanks by 2^(scale_shift).
left_context: Integer, number of preceding frames to attach to each frame.
right_context: Integer, number of preceding frames to attach to each frame.
frame_stride: Integer... |
combine_chunk_392019 | combine.txt | 392,019 | 512 | the License.
# ==============================================================================
"""Metrics model generator for Blazeface.
The produced model is to be used as part of the mini-benchmark, combined into
the same flatbuffer with the main model.
The blazeface model is described in
https://tfhub.dev/tensorfl... |
combine_chunk_392020 | combine.txt | 392,020 | 512 | # 0.1 to use more possible boxes based on experimentation with the model.
high_scoring_indices = tf.math.logical_or(
tf.math.greater(squashed_expected_scores, 0.1),
tf.math.greater(squashed_actual_scores, 0.1))
high_scoring_actual_boxes = tf.where(
condition=tf.broadcast_to(
input=high... |
combine_chunk_392021 | combine.txt | 392,021 | 512 | expected_scores, actual_box_encodings,
actual_scores
], [kld_metric, box_mse, ok])
converter.experimental_new_converter = True
tflite_model = converter.convert()
if sys.byteorder == 'big':
tflite_model = flatbuffer_utils.byte_swap_tflite_buffer(
tflite_model, 'big', 'little'
... |
combine_chunk_392022 | combine.txt | 392,022 | 512 | 7, dtype=tf.float32, name='epsilon')
p = tf.math.maximum(predicted, epsilon)
q = tf.math.maximum(actual, epsilon)
kld_1 = tf.math.reduce_sum(
tf.math.multiply(p, tf.math.log(tf.math.divide(p, q))))
kld_2 = tf.math.reduce_sum(
tf.math.multiply(q, tf.math.log(tf.math.divide(q, p))))
return tf.add(kl... |
combine_chunk_392023 | combine.txt | 392,023 | 512 | .float32, shape=[1, 1001])
mse = tf.reshape(
tf.math.reduce_mean((expected_scores - actual_scores)**2), [1],
name='mse')
kld_metric = kl_divergence.symmetric_kl_divergence(expected_scores,
actual_scores)
kld_metric = tf.reshape(kld_metri... |
combine_chunk_392024 | combine.txt | 392,024 | 512 | associated files copier.
A TFLite model with metadata may have 'associated files': extra data stored as a
zip file appended to the model. This script copies such files from one model to
another. This is used as part of constructing validation models.
See https://www.tensorflow.org/lite/convert/metadata for descripti... |
combine_chunk_392025 | combine.txt | 392,025 | 512 | # limitations under the License.
# ==============================================================================
"""Simple script to convert binary file to C++ source code for embedding."""
# This is a version of //tensorflow/lite/python/convert_file_to_c_source.py
# with minimal dependencies to reduce build times. S... |
combine_chunk_392026 | combine.txt | 392,026 | 512 | _license:
license_text = """
/* Copyright {year} The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... |
combine_chunk_392027 | combine.txt | 392,027 | 512 | header_text
def main():
parser = argparse.ArgumentParser(
description=("Binary to C++ source converter"))
parser.add_argument(
"--input_binary_file",
type=str,
help="Full filepath of input binary.",
required=True)
parser.add_argument(
"--output_header_file",
type=str,
... |
combine_chunk_392028 | combine.txt | 392,028 | 512 | License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific languag... |
combine_chunk_392029 | combine.txt | 392,029 | 512 | _floor_div_tests, make_floor_mod_tests, make_squared_difference_tests
from tensorflow.lite.testing.op_tests.bitcast import make_bitcast_tests
from tensorflow.lite.testing.op_tests.bitwise_xor import make_bitwise_xor_tests
from tensorflow.lite.testing.op_tests.broadcast_args import make_broadcast_args_tests
from tensorf... |
combine_chunk_392030 | combine.txt | 392,030 | 512 | _tests.elu import make_elu_tests
from tensorflow.lite.testing.op_tests.embedding_lookup import make_embedding_lookup_tests
from tensorflow.lite.testing.op_tests.equal import make_equal_tests
from tensorflow.lite.testing.op_tests.exp import make_exp_tests
from tensorflow.lite.testing.op_tests.expand_dims import make_exp... |
combine_chunk_392031 | combine.txt | 392,031 | 512 | .leaky_relu import make_leaky_relu_tests
from tensorflow.lite.testing.op_tests.less import make_less_tests
from tensorflow.lite.testing.op_tests.less_equal import make_less_equal_tests
from tensorflow.lite.testing.op_tests.local_response_norm import make_local_response_norm_tests
from tensorflow.lite.testing.op_tests.l... |
combine_chunk_392032 | combine.txt | 392,032 | 512 | .testing.op_tests.real import make_real_tests
from tensorflow.lite.testing.op_tests.reciprocal import make_reciprocal_tests
from tensorflow.lite.testing.op_tests.reduce import make_mean_tests, make_sum_tests, make_reduce_prod_tests, make_reduce_max_tests, make_reduce_min_tests, make_reduce_any_tests, make_reduce_all_te... |
combine_chunk_392033 | combine.txt | 392,033 | 512 | .space_to_depth import make_space_to_depth_tests
from tensorflow.lite.testing.op_tests.sparse_to_dense import make_sparse_to_dense_tests
from tensorflow.lite.testing.op_tests.split import make_split_tests
from tensorflow.lite.testing.op_tests.splitv import make_splitv_tests
from tensorflow.lite.testing.op_tests.squeeze... |
combine_chunk_392034 | combine.txt | 392,034 | 512 | , make_unsorted_segment_sum_tests
from tensorflow.lite.testing.op_tests.where import make_where_tests
from tensorflow.lite.testing.op_tests.where_v2 import make_where_v2_tests
from tensorflow.lite.testing.op_tests.while_loop import make_while_tests
from tensorflow.lite.testing.op_tests.zeros_like import make_zeros_like... |
combine_chunk_392035 | combine.txt | 392,035 | 512 | for HLO target.
self.hlo_aware_conversion = True
# The function to convert a TensorFLow model to TFLite model.
# See the document for `mlir_convert` function for its required signature.
self.tflite_convert_function = None
# A map from regular expression to bug number. Any test failure with label
... |
combine_chunk_392036 | combine.txt | 392,036 | 512 | _prepare_dir(options)
out = options.zip_to_output
# Some zip filenames contain a postfix identifying the conversion mode. The
# list of valid conversion modes is defined in
# generated_test_conversion_modes() in build_def.bzl.
if options.multi_gen_state:
test_name = options.multi_gen_state.test_name
... |
combine_chunk_392037 | combine.txt | 392,037 | 512 | _examples(new_options)
zipinfo = zipfile.ZipInfo("manifest.txt")
archive.writestr(zipinfo, "".join(multi_gen_state.zip_manifest),
zipfile.ZIP_DEFLATED)
<|file|>tensorflow/tensorflow/lite/testing/zip_test_utils.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed u... |
combine_chunk_392038 | combine.txt | 392,038 | 512 | the test function according to the test function name."""
if test_function_name not in _MAKE_TEST_FUNCTIONS_MAP:
return None
return _MAKE_TEST_FUNCTIONS_MAP[test_function_name]
RANDOM_SEED = 342
MAP_TF_TO_NUMPY_TYPE = {
tf.float32: np.float32,
tf.float16: np.float16,
tf.float64: np.float64,
... |
combine_chunk_392039 | combine.txt | 392,039 | 512 | .int32, tf.uint8, tf.int8, tf.int64, tf.uint16,
tf.int16):
value = np.random.randint(min_value, max_value + 1, shape)
elif dtype == tf.bool:
value = np.random.choice([True, False], size=shape)
elif dtype == np.bytes_:
# Not the best strings, but they will do for some basic testing.
... |
combine_chunk_392040 | combine.txt | 392,040 | 512 | List of output tensors
Returns:
The frozen graph_def.
"""
return convert_to_constants.convert_variables_to_constants(
session, session.graph.as_graph_def(), [x.op.name for x in outputs])
def format_result(t):
"""Convert a tensor to a format that can be used in test specs."""
if t.dtype.kind not ... |
combine_chunk_392041 | combine.txt | 392,041 | 512 | class TextFormatWriter:
"""Utility class for writing ProtoBuf like messages."""
def __init__(self, fp, name=None, parent=None):
self.fp = fp
self.indent = parent.indent if parent else 0
self.name = name
def __enter__(self):
if self.name:
self.write(self.name + " {")
self.indent += 2
... |
combine_chunk_392042 | combine.txt | 392,042 | 512 | _field("value", format_result(value))
# Expectations
for name, value in example["outputs"].items():
with invoke.sub_message("output") as output_msg:
output_msg.write_field("key", name)
output_msg.write_field("value", format_result(value))
with invoke.sub_message("output_s... |
combine_chunk_392043 | combine.txt | 392,043 | 512 | expected_tf_failures=0):
"""Helper to make a zip file of a bunch of TensorFlow models.
This does a cartesian product of the dictionary of test_parameters and
calls make_graph() for each item in the cartesian product set.
If the graph is built successfully, then make_test_inputs() is calle... |
combine_chunk_392044 | combine.txt | 392,044 | 512 | ))
if options.multi_gen_state:
options.multi_gen_state.parameter_count = all_parameter_count
# TODO(aselle): Make this allow multiple inputs outputs.
if options.multi_gen_state:
archive = options.multi_gen_state.archive
else:
archive = zipfile.PyZipFile(zip_path, "w")
zip_manifest = []
convert_... |
combine_chunk_392045 | combine.txt | 392,045 | 512 | _path.replace(".zip", "_") + str(i)
i += 1
if label in processed_labels:
# Do not populate data for the same label more than once. It will cause
# errors when unzipping.
continue
processed_labels.add(label)
param_dict = dict(zip(keys, curr))
if options.make_tf_pt... |
combine_chunk_392046 | combine.txt | 392,046 | 512 | _log` (log of conversion), `tf_log` (log of tf
conversion), `converter` (a string of success status of the
conversion), `tf` (a string success status of the conversion).
"""
np.random.seed(RANDOM_SEED)
report = {
"tflite_converter": report_lib.NOTRUN,
... |
combine_chunk_392047 | combine.txt | 392,047 | 512 | outputs=tensor_info_outputs,
method_name="op_test"))
saved_model_dir = tempfile.mkdtemp("op_test")
saved_model_tags = [tf.saved_model.SERVING]
signature_key = signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY
builder = tf.compat.v1.saved_mo... |
combine_chunk_392048 | combine.txt | 392,048 | 512 | ])
zipinfo = zipfile.ZipInfo(zip_path_label + ".inputs")
archive.writestr(zipinfo, example_fp.getvalue(), zipfile.ZIP_DEFLATED)
example_fp2 = io.StringIO()
write_test_cases(example_fp2, zip_path_label + ".bin", [example])
zipinfo = zipfile.ZipInfo(zip_path_label + "_te... |
combine_chunk_392049 | combine.txt | 392,049 | 512 |
if tf_success > 0:
percent = float(converter_success) / float(tf_success) * 100.
tf.compat.v1.logging.info(
("Archive %s Considered %d graphs, %d TF evaluated graphs "
" and %d converted graphs (%.1f%%"), zip_path, total_conversions,
tf_success, converter_success, percent)
tf_failures = p... |
combine_chunk_392050 | combine.txt | 392,050 | 512 | input_k_dtype": [tf.int32, tf.int16],
"input_shape": [[10], [5, 20]],
"input_k": [None, 1, 3],
"output_index_dtype": [tf.int32, tf.int16],
}]
def build_graph(parameters):
"""Build the topk op testing graph."""
input_value = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"]... |
combine_chunk_392051 | combine.txt | 392,051 | 512 | distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test configs for expand_... |
combine_chunk_392052 | combine.txt | 392,052 | 512 | _values, sess.run(
outputs, feed_dict=dict(zip(inputs, input_values)))
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/global_batch_norm.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache L... |
combine_chunk_392053 | combine.txt | 392,053 | 512 | (input_tensor, x_norm)
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
input_value = create_tensor_data(parameters["dtype"],
parameters["input_shape"])
return [input_value], sess.run(
outputs, feed_dict=dict(zip(inputs, [input... |
combine_chunk_392054 | combine.txt | 392,054 | 512 | , 5]],
"perm": [[4, 3, 2, 1, 0]],
"constant_perm": [True, False],
"fully_quantize": [False],
}, {
"dtype": [tf.float32],
"input_shape": [[2, 2, 3]],
"perm": [[0, 1, 2], [0, 2, 1]],
"constant_perm": [True],
"fully_quantize": [True],
}, {
"dtype": [tf.float32],
... |
combine_chunk_392055 | combine.txt | 392,055 | 512 | "]))
return values, sess.run(outputs, feed_dict=dict(zip(inputs, values)))
make_zip_of_tests(
options,
test_parameters,
build_graph,
build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/einsum.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed unde... |
combine_chunk_392056 | combine.txt | 392,056 | 512 | LBH,BL->BH"),
((2, 5, 7), (5, 3, 2), "LBH,BKL->BKH"),
((2, 5, 7, 3), (2, 4, 7, 3), "BFNH,BTNH->BNFT"),
((2, 5, 7, 3), (7, 3, 4), "BFND,NDH->BFH"),
((3, 4, 5), (5, 6, 2), "BFD,DNH->BFNH"),
((7, 11, 13), (7, 11, 13, 5), "BIN,BINJ->BIJ"),
... |
combine_chunk_392057 | combine.txt | 392,057 | 512 | shapes"][1]
equation = parameters["shapes"][2]
input0_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"], shape=input0_shape)
input1_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"], shape=input1_shape)
out = tf.einsum(equation, input0_tensor, input1_tensor)
re... |
combine_chunk_392058 | combine.txt | 392,058 | 512 | , 1, 3], [1, 1, 1, 3]),
([2, 3, 4, 5], [2, 3, 4, 5]), ([2, 3, 3], [2, 3]),
([5, 5], [1]), ([10], [2, 4, 10])],
}]
def build_graph(parameters):
"""Build the not equal op testing graph."""
input_value1 = tf.compat.v1.placeholder(
dtype=parameters[... |
combine_chunk_392059 | combine.txt | 392,059 | 512 | _zip_of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_function()
def make_split_tests(options):
"""Make a set of tests to do tf.split."""
test_parameters = [{
"input_shape": [[1, 3, 4, 6], [2, 4, 1], [6, 4], [8]],
"num_or_size_splits": [1, 2,... |
combine_chunk_392060 | combine.txt | 392,060 | 512 | _bilinear_tests(options):
"""Make a set of tests to do resize_bilinear."""
test_parameters = [{
"dtype": [tf.float32, tf.int32],
"input_shape": [[1, 3, 4, 3], [1, 10, 2, 1]],
"size": [[1, 1], [4, 3], [2, 2], [5, 6]],
"align_corners": [True, False],
"half_pixel_centers": [False],
... |
combine_chunk_392061 | combine.txt | 392,061 | 512 | =parameters["input_shape"])
out = tf.compat.v1.image.resize_bilinear(
input_tensor,
size=parameters["size"],
align_corners=parameters["align_corners"],
half_pixel_centers=parameters["half_pixel_centers"])
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, ... |
combine_chunk_392062 | combine.txt | 392,062 | 512 | _data(parameters["input_dtype"],
parameters["input_shape"])
return [input_value], sess.run(outputs, dict(zip(inputs, [input_value])))
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/unpack.py
# Copyri... |
combine_chunk_392063 | combine.txt | 392,063 | 512 | =dict(zip(inputs, [input_value])))
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/reverse_sequence.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... |
combine_chunk_392064 | combine.txt | 392,064 | 512 | ",
shape=parameters["input_shape"])
outs = tf.reverse_sequence(
input=input_value,
seq_lengths=parameters["seq_lengths"],
batch_axis=parameters["batch_axis"],
seq_axis=parameters["seq_axis"])
return [input_value], [outs]
def build_inputs(parameters, sess, inputs, outpu... |
combine_chunk_392065 | combine.txt | 392,065 | 512 | key_tensor = tf.constant(keys, dtype=key_dtype)
value_tensor = tf.constant(values, dtype=value_dtype)
initializer = tf.lookup.KeyValueTensorInitializer(key_tensor, value_tensor)
table = tf.lookup.StaticHashTable(initializer, default_value)
with tf.control_dependencies(
[tf.compat.v1.initializ... |
combine_chunk_392066 | combine.txt | 392,066 | 512 | of tests to do transpose_conv."""
# Tensorflow only supports equal strides
test_parameters = [
{
"input_shape": [[1, 3, 4, 1], [1, 10, 10, 3], [3, 20, 20, 1]],
"filter_size": [[1, 1], [1, 2], [3, 3]],
"has_bias": [False],
"strides": [[1, 1, 1, 1], [1, 3, 3, 1]],
... |
combine_chunk_392067 | combine.txt | 392,067 | 512 | , 1]],
"padding": ["SAME"],
"data_format": ["NHWC"],
"channel_multiplier": [1],
"output_shape": [[1, 6, 6, 2]],
"fully_quantize": [True],
"const_weight_bias": [True]
},
{
"input_shape": [[1, 4, 3, 1]],
"filter_size": [[3, 3, 2, ... |
combine_chunk_392068 | combine.txt | 392,068 | 512 | padding=parameters["padding"],
data_format=parameters["data_format"])
out = tf.compat.v1.nn.conv2d_backprop_input(
input_shape,
filter_input,
conv_outputs,
strides=parameters["strides"],
padding=parameters["padding"],
data_format=para... |
combine_chunk_392069 | combine.txt | 392,069 | 512 | the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WI... |
combine_chunk_392070 | combine.txt | 392,070 | 512 | build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/conv3d.py
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... |
combine_chunk_392071 | combine.txt | 392,071 | 512 | _shape"])
out = tf.nn.conv3d(
input_tensor,
filter_tensor,
strides=parameters["strides"],
dilations=parameters["dilations"],
padding=parameters["padding"])
return [input_tensor, filter_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
values = [
... |
combine_chunk_392072 | combine.txt | 392,072 | 512 | .sigmoid(input_tensor)
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
min_value, max_value = parameters["input_range"]
input_values = create_tensor_data(parameters["dtype"],
parameters["input_shape"], min_value,
... |
combine_chunk_392073 | combine.txt | 392,073 | 512 | (
outputs, feed_dict={inputs[0]: input_values})
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/fill.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");... |
combine_chunk_392074 | combine.txt | 392,074 | 512 | (
options,
test_parameters,
build_graph,
build_inputs,
expected_tf_failures=20)
@register_make_test_function()
def make_fill_16_tests(options):
"""Make a set of tests to do fill with fp16."""
test_parameters = [{
"dims_dtype": [tf.int32, tf.int64],
"dims_shape": [[], [1]... |
combine_chunk_392075 | combine.txt | 392,075 | 512 | [{
"input_shape": [[5, 7], [1, 1, 1, 1], [1, 3, 4, 3], [3, 15, 14, 3]],
"dim": [0, 1, 2, 3, [2, 3], -2],
"epsilon": [None, 1e-12, 1e-3],
"fully_quantize": [False],
}, {
"input_shape": [[1, 1, 1, 1], [1, 3, 4, 3], [3, 15, 14, 3]],
"dim": [3],
"epsilon": [None, 1e-12],
"... |
combine_chunk_392076 | combine.txt | 392,076 | 512 |
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#... |
combine_chunk_392077 | combine.txt | 392,077 | 512 | ize": [False],
"quant_16x8": [False]
},
{
"input_shape": [[1, 3, 4, 3], [1, 10, 10, 3]],
"filter_size": [[1, 1], [1, 2], [3, 3]],
"strides": [[1, 1, 1, 1], [1, 3, 3, 1]],
"dilations": [[1, 1, 1, 1], [1, 3, 2, 1], [1, 2, 2, 1]],
"channel_multiplier"... |
combine_chunk_392078 | combine.txt | 392,078 | 512 | _shape[3], parameters["channel_multiplier"]
]
return [input_shape, filter_shape]
def build_graph(parameters):
"""Build a depthwise conv graph given `parameters`."""
input_shape, filter_shape = get_tensor_shapes(parameters)
input_tensor = tf.compat.v1.placeholder(
dtype=tf.float32, name="i... |
combine_chunk_392079 | combine.txt | 392,079 | 512 |
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#... |
combine_chunk_392080 | combine.txt | 392,080 | 512 | is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test configs for bitc... |
combine_chunk_392081 | combine.txt | 392,081 | 512 | _dtype": [tf.int16],
"output_dtype": [tf.float32],
"input_shape": [[2], [1, 2], [1, 2, 2], [3, 4, 5, 6, 2]],
}
]
def build_graph(parameters):
"""Build the bitcast testing graph."""
input_value = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
name="input... |
combine_chunk_392082 | combine.txt | 392,082 | 512 | ["dtype"], name="y", shape=parameters["input_shape"])
dy = tf.compat.v1.placeholder(
dtype=parameters["dtype"], name="dy", shape=parameters["input_shape"])
out = tf.raw_ops.SigmoidGrad(y=y, dy=dy)
return [y, dy], [out]
def build_inputs(parameters, sess, inputs, outputs):
# input is y which is... |
combine_chunk_392083 | combine.txt | 392,083 | 512 | "input_shape": [[2, 3, 4, 16]],
"block_size": [2, 4],
"fully_quantize": [True, False],
}]
def build_graph(parameters):
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"],
name="input",
shape=parameters["input_shape"])
out = tf.compat.v1.depth_to_spa... |
combine_chunk_392084 | combine.txt | 392,084 | 512 | ]]
}]
def build_graph(parameters):
"""Build the atan2 op testing graph."""
input_value1 = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
name="y",
shape=parameters["input_shape"])
input_value2 = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
... |
combine_chunk_392085 | combine.txt | 392,085 | 512 | parameters["input_dtype"],
name="input",
shape=parameters["input_shape"])
out = tf.negative(input_tensor)
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
values = create_tensor_data(parameters["input_dtype"],
parameters["in... |
combine_chunk_392086 | combine.txt | 392,086 | 512 | a list of scalar, shaped of "updates_count".
updates_tensors = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
name="updates",
shape=[parameters["updates_count"]])
out = tf.tensor_scatter_nd_update(input_tensor, indices_tensor,
updates_t... |
combine_chunk_392087 | combine.txt | 392,087 | 512 | .int32, tf.float32],
"multi_node": [0]
}, {
"data_shape": [[2, 3, 4], [2, 5, 2]],
"segment_id": [[0, 1]],
"num_segments": [2],
"dtype": [tf.int32, tf.float32],
"multi_node": [0]
}, {
"data_shape": [[4]],
"segment_id": [[0, 0, 1, 8]],
"num_segments": [9],
"... |
combine_chunk_392088 | combine.txt | 392,088 | 512 | ]], [[1, 2, 4], [0, 0, -1]]]],
"num_segments": [10],
"dtype": [tf.int32, tf.float32],
"multi_node": [0]
}, {
"data_shape": [[2, 0, 3]],
"segment_id": [[1, 1]],
"num_segments": [2],
"dtype": [tf.int32, tf.float32],
"multi_node": [0]
}]
def build_graph_one_node(param... |
combine_chunk_392089 | combine.txt | 392,089 | 512 | create_tensor_data(
parameters["dtype"], shape=parameters["data_shape"])
return [data_value], sess.run(
outputs, feed_dict=dict(zip(inputs, [data_value])))
def build_inputs_multi_node(parameters, sess, inputs, outputs):
data_value = create_tensor_data(
dtype=parameters["dtype"], shap... |
combine_chunk_392090 | combine.txt | 392,090 | 512 | division
from __future__ import print_function
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_functio... |
combine_chunk_392091 | combine.txt | 392,091 | 512 | 0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
... |
combine_chunk_392092 | combine.txt | 392,092 | 512 | , outputs):
input_values = [
create_tensor_data(
np.float32, parameters["input_shape"], min_value=-4, max_value=10)
for _ in range(len(inputs))
]
return input_values, sess.run(
outputs, feed_dict=dict(zip(inputs, input_values)))
make_zip_of_tests(options, test_paramet... |
combine_chunk_392093 | combine.txt | 392,093 | 512 | parameters["dtype"],
name="split_{}".format(i),
shape=[num_batches, input_vec_size])
inputs_after_split.append(one_timestamp_input)
lstm_cell = tf.compat.v1.nn.rnn_cell.BasicLSTMCell(
num_cells, activation=tf.nn.relu, state_is_tuple=True)
sequence_length = None
if paramete... |
combine_chunk_392094 | combine.txt | 392,094 | 512 | a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the sp... |
combine_chunk_392095 | combine.txt | 392,095 | 512 |
return counter < num_iterations_scalar
def body_fn(counter, value, increment_value):
new_counter = counter + 1
if parameters["dtype"] == tf.string:
# Use fill op to create new string value with the given counter value.
del value
new_value = tf.fill([1], tf.reshape(increme... |
combine_chunk_392096 | combine.txt | 392,096 | 512 | with NCHW layout to
make sure that the tranformations to NHWC works as expected. Note this
doesn't check any performance so manual checking of the generated model is
advised.
Args:
activation_op: The activation op to be used in the test.
Returns:
The function that creates the test.
"""
def cre... |
combine_chunk_392097 | combine.txt | 392,097 | 512 | max_value=10)
input_tensors = [input_tensor]
if parameters["data_format"] == "NCHW":
out = add_conv(input_tensor, filter_input, parameters)
else:
out = tf.nn.conv2d(
input=input_tensor,
filters=filter_input,
strides=parameters["strides"],
... |
combine_chunk_392098 | combine.txt | 392,098 | 512 | www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and... |
combine_chunk_392099 | combine.txt | 392,099 | 512 | ides"],
dilations=parameters["dilations"],
padding=parameters["padding"])
return [input_tensor, filter_tensor, output_shape], [out]
def calculate_output_shape(parameters):
def calculate_shape(idx):
input_size = parameters["input_shape"][idx]
filter_size = parameters["filter_shape... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.