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_392200 | combine.txt | 392,200 | 512 | 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
#
# Unless required by applicable law or agreed to... |
combine_chunk_392201 | combine.txt | 392,201 | 512 | num_upper)
return [input_tensor, num_lower, num_upper], [out]
def build_inputs(parameters, sess, inputs, outputs):
static_input_shape = get_static_shape(parameters["input_shape"])
input_value = create_tensor_data(parameters["input_dtype"],
static_input_shape)
num... |
combine_chunk_392202 | combine.txt | 392,202 | 512 | (parameters):
input_shape = parameters["input_diag_shapes"][0]
diag_shape = parameters["input_diag_shapes"][1]
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"], name="input", shape=input_shape)
diag_tensor = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"... |
combine_chunk_392203 | combine.txt | 392,203 | 512 | 1, 2, 2], [0, 1, 2, 3],
[0, 0, 0, 0]],
},
]
def build_graph(parameters):
"""Build the segment_sum op testing graph."""
data = tf.compat.v1.placeholder(
dtype=parameters["data_dtype"],
name="data",
shape=parameters["data_shape"])
segment_ids = tf.... |
combine_chunk_392204 | combine.txt | 392,204 | 512 | """Actual function that generates examples.
Args:
options: An Options instance.
expected_tf_failures: number of expected tensorflow failures.
"""
# Chose a set of parameters
test_parameters = [
{
"ksize": [[2, 1, 1, 2], [1, 1, 1, 1], [1, 1, 2, 1], [1, 10, 11, 1]],
... |
combine_chunk_392205 | combine.txt | 392,205 | 512 | False]
},
{
"ksize": [[1, 1, 1, 1]],
"strides": [[1, 1, 1, 1]],
"input_shape": [[1, 1, 1, 1]],
"padding": ["SAME", "VALID"],
"data_format": ["NHWC"],
"fully_quantize": [True],
"quant_16x8": [True]
}
]
# t... |
combine_chunk_392206 | combine.txt | 392,206 | 512 | _tests(options):
make_pool_tests(
tf.nn.avg_pool2d, allow_fully_quantize=True)(
options, expected_tf_failures=160)
@register_make_test_function()
def make_max_pool_tests(options):
make_pool_tests(
tf.nn.max_pool2d, allow_fully_quantize=True)(
options, expected_tf_failures=160)
<|f... |
combine_chunk_392207 | combine.txt | 392,207 | 512 | (options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/cumsum.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 ... |
combine_chunk_392208 | combine.txt | 392,208 | 512 | 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,... |
combine_chunk_392209 | combine.txt | 392,209 | 512 | [[5, 3]],
"shape2": [[5, 3]],
"transpose_a": [True],
"transpose_b": [False],
"constant_filter": [True, False],
"fully_quantize": [False],
"quant_16x8": [False]
}, {
"shape1": [[1, 3]],
"shape2": [[3, 3]],
"transpose_a": [False],
"transpose_b": [False],
... |
combine_chunk_392210 | combine.txt | 392,210 | 512 | "shape1": [[3, 0]],
"shape2": [[0, 3]],
"transpose_a": [False],
"transpose_b": [False],
"constant_filter": [True, False],
"fully_quantize": [False],
"quant_16x8": [False]
}]
def build_graph(parameters):
"""Build a matmul graph given `parameters`."""
input_tensor1 =... |
combine_chunk_392211 | combine.txt | 392,211 | 512 | 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is dis... |
combine_chunk_392212 | combine.txt | 392,212 | 512 | 2019 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
#
# Unless required by applicable law or ... |
combine_chunk_392213 | combine.txt | 392,213 | 512 | _range": [(-10, 10)],
},
{
# 2D-3D example. Share the 2nd axis.
"input_shape": [[20, 20], [20, 20, 20]],
"shared_axes": [[1]],
"fully_quantize": [True],
"input_range": [(-10, 10)],
},
]
def build_graph(parameters):
"""Build the graph for the t... |
combine_chunk_392214 | combine.txt | 392,214 | 512 | implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test configs for embedding_lookup."""
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import create_ten... |
combine_chunk_392215 | combine.txt | 392,215 | 512 | configs for greater_equal."""
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_function()
def make_great... |
combine_chunk_392216 | combine.txt | 392,216 | 512 | <|file|>tensorflow/tensorflow/lite/testing/op_tests/reshape.py
# Copyright 2019 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... |
combine_chunk_392217 | combine.txt | 392,217 | 512 | ": [tf.float32],
"input_shape": [[1, 4, 0]],
"output_shape": [[2, -1], [2, 0, -1]],
"constant_shape": [True, False],
"fully_quantize": [False],
}
]
def build_graph(parameters):
"""Build the graph for reshape tests."""
input_tensor = tf.compat.v1.placeholder(
... |
combine_chunk_392218 | combine.txt | 392,218 | 512 | _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_function()
def make_fused_batch_norm_tests(options):
"""Make a set of tests to do fused_batch_norm."""
test_para... |
combine_chunk_392219 | combine.txt | 392,219 | 512 | dtype"], input_shape),
create_tensor_data(parameters["dtype"], input_shape)
]
return input_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/rank.py... |
combine_chunk_392220 | combine.txt | 392,220 | 512 | .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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
... |
combine_chunk_392221 | combine.txt | 392,221 | 512 | 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either... |
combine_chunk_392222 | combine.txt | 392,222 | 512 | ": [[2, 3]],
"begin": [[0, 0], [1, 0]],
"size": [[2, 3], [2, 2]],
"constant_indices": [False],
"fully_quantize": [False],
},
# 4-D with size -1
{
"dtype": [tf.float32],
"index_type": [tf.int32],
"input_shape": [[4, 4, 4, 4]],
... |
combine_chunk_392223 | combine.txt | 392,223 | 512 | ": [[2, 3], [2, 2]],
"constant_indices": [True],
"fully_quantize": [True],
},
# 4-D with size -1
{
"dtype": [tf.float32],
"index_type": [tf.int32],
"input_shape": [[4, 4, 4, 4]],
"begin": [[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0... |
combine_chunk_392224 | combine.txt | 392,224 | 512 | dtype=parameters["index_type"],
name="begin",
shape=[len(parameters["input_shape"])])
size = tf.compat.v1.placeholder(
dtype=parameters["index_type"],
name="size",
shape=[len(parameters["input_shape"])])
tensors = [input_tensor, begin, size]
... |
combine_chunk_392225 | combine.txt | 392,225 | 512 | .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_function()
def make_l2norm_shared_epsilon_tests(options):
"""Regression test for a bug (b/122651451)."""
# Chose a set of parameters
test_parameters = [{
... |
combine_chunk_392226 | combine.txt | 392,226 | 512 | """Make a set of tests to do TensorListConcatV2."""
test_parameters = [
{
"element_dtype": [tf.float32, tf.int32],
"num_elements": [4, 5, 6],
"element_shape": [[5], [3, 3]],
},
]
def build_graph(parameters):
"""Build the TensorListConcatV2 op testing graph."""
... |
combine_chunk_392227 | combine.txt | 392,227 | 512 | [3, 8, 8], [3, 8]],
"fft_length": [None, [4], [8], [16]]
}]
def build_graph(parameters):
input_value = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
name="input",
shape=parameters["input_shape"])
outs = tf.signal.rfft(input_value, fft_length=parameters["fft_lengt... |
combine_chunk_392228 | combine.txt | 392,228 | 512 | [[], [1], [2, 3], [1, 3, 4, 3], [2, 2, 3, 4, 5, 6]],
"Tout": [tf.float64]
}]
def build_graph(parameters):
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"],
name="input",
shape=parameters["input_shape"])
out = tf.raw_ops.ComplexAbs(x=input_tensor, Tout=parame... |
combine_chunk_392229 | combine.txt | 392,229 | 512 | def build_graph(parameters):
"""Make a set of tests to do eye."""
input_tensor0 = tf.compat.v1.placeholder(
dtype=tf.int32, name="num_rows", shape=parameters["num_rows_shape"])
input_tensor1 = tf.compat.v1.placeholder(
dtype=tf.int32, name="num_columns", shape=parameters["num_cols_shape"]... |
combine_chunk_392230 | combine.txt | 392,230 | 512 | def make_space_to_depth_tests(options):
"""Make a set of tests to do space_to_depth."""
test_parameters = [{
"dtype": [tf.float32, tf.int32, tf.uint8, tf.int64],
"input_shape": [[2, 12, 24, 1]],
"block_size": [2, 3, 4],
"fully_quantize": [False],
}, {
"dtype": [tf.float32],
"i... |
combine_chunk_392231 | combine.txt | 392,231 | 512 | TEST_INPUT_DEPTH = 3
@register_make_test_function()
def make_control_dep_tests(options):
"""Make a set of tests that use control dependencies."""
test_parameters = [{
"input_shape": [[], [1, 1, 1, 1], [1, 15, 14, 1], [3, 15, 14, 3]],
}]
def build_graph(parameters):
input_tensor = tf.compat.v1.plac... |
combine_chunk_392232 | combine.txt | 392,232 | 512 | _make_test_function()
def make_gather_with_constant_tests(options):
"""Make a set of test which feed a constant to gather."""
test_parameters = [{
"input_shape": [[3]],
"reference_shape": [[2]],
}, {
"input_shape": [[2, 3]],
"reference_shape": [[2, 3]],
}]
def build_graph(parameters)... |
combine_chunk_392233 | combine.txt | 392,233 | 512 | , 3, 3], [4, 6, 1]],
"filter_size": [1, 2, 3],
"stride": [1, 2],
"dilations": [1, 2, 3],
"padding": ["VALID", "SAME"],
"num_filters": [1, 2],
},
]
def get_tensor_shapes(parameters):
input_shape = parameters["input_shape"]
filter_size = parameters["fil... |
combine_chunk_392234 | combine.txt | 392,234 | 512 | express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test configs for unfused_gru."""
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import crea... |
combine_chunk_392235 | combine.txt | 392,235 | 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 conv.""... |
combine_chunk_392236 | combine.txt | 392,236 | 512 | =parameters["data_format"])
# Add the 2 results up.
out = result1 + result2
return input_tensors, [out]
def build_inputs(parameters, sess, inputs, outputs):
# Build list of input values either containing 1 tensor (input) or 2 tensors
# (input, filter) based on whether filter is constant or variab... |
combine_chunk_392237 | combine.txt | 392,237 | 512 | 32, 32, 1, 3]],
"fully_quantize": [False, True],
}]
def build_graph(parameters):
"""Build the minimum op testing graph."""
input_tensor_1 = tf.compat.v1.placeholder(
dtype=parameters["input_dtype"],
name="input_1",
shape=parameters["input_shape_1"])
input_tensor_2 = tf.com... |
combine_chunk_392238 | combine.txt | 392,238 | 512 | = [{
"input_dtype": [tf.float32, tf.int16, tf.int32, tf.int64],
"input_shape_pair": [([1, 1, 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])],
"fully_quantize": [False],
}, {
"inpu... |
combine_chunk_392239 | combine.txt | 392,239 | 512 | .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
# limitat... |
combine_chunk_392240 | combine.txt | 392,240 | 512 | make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/op_tests/sparse_to_dense.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... |
combine_chunk_392241 | combine.txt | 392,241 | 512 | "] and parameters["value_count"] == 1:
value = tf.compat.v1.placeholder(
name="value", dtype=parameters["value_dtype"], shape=())
else:
value = tf.compat.v1.placeholder(
name="value",
dtype=parameters["value_dtype"],
shape=[parameters["value_count"]])
indices ... |
combine_chunk_392242 | combine.txt | 392,242 | 512 | set of parameters
test_parameters = [{
"input_shape": [[1, 10, 10, 64], [3, 8, 32]],
"scale_n_axis": [([2, 2], [1, 2]), ([3, 4], [1, 2]), ([3], [1])],
"dtype": [tf.float32, tf.int32],
}]
def new_shape_for_upsample(original_shape, scales, axis):
"""Calculate the input shape & ones shape, al... |
combine_chunk_392243 | combine.txt | 392,243 | 512 | 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distrib... |
combine_chunk_392244 | combine.txt | 392,244 | 512 | , 3]],
"activation": [True, False],
"fully_quantize": [False],
"dynamic_range_quantize": [False],
},
{
"dtype": [tf.float32],
"input_shape_1": [[]],
"input_shape_2": [[]],
"activation": [False],
"fully_quantize": [False],
... |
combine_chunk_392245 | combine.txt | 392,245 | 512 | _1": [[5]],
"input_shape_2": [[5]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
},
{
"dtype": [tf.float32],
"input_shape_1": [[1, 3, 4, 3]],
"input_shape_2": [[3]],
"activation": [False],
... |
combine_chunk_392246 | combine.txt | 392,246 | 512 | 1],
}
]
# test_parameters include fully_quantize option only when
# allow_fully_quantize is True.
if not allow_fully_quantize:
test_parameters = [
test_parameter for test_parameter in test_parameters
if True not in test_parameter["fully_quantize"]
]
def populate_dynamic_sha... |
combine_chunk_392247 | combine.txt | 392,247 | 512 | def make_add_tests(options):
"""Make zip tests for add op with uint32 and int16 case."""
test_parameters = [
{
"dtype": [tf.uint32],
"input_shape_1": [[1, 3, 3, 3], [1], [3, 3]],
"input_shape_2": [[3], [1]],
"activation": [False],
"fully_quantize": [False],
... |
combine_chunk_392248 | combine.txt | 392,248 | 512 | "input_shape_1": [[1, 3, 3, 3, 3]],
"input_shape_2": [[3]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [False],
},
{
"dtype": [tf.int16],
"input_shape_1": [[1, 3, 3, 3]],
"input_shape_2": [[3], [... |
combine_chunk_392249 | combine.txt | 392,249 | 512 | },
]
make_binary_op_tests(
options, tf.math.floormod, test_parameters=test_parameters
)
@register_make_test_function()
def make_squared_difference_tests(options):
make_binary_op_tests(
options, tf.math.squared_difference, allow_fully_quantize=True)
<|file|>tensorflow/tensorflow/lite/testing... |
combine_chunk_392250 | combine.txt | 392,250 | 512 | False, True],
"rhs_constant": [False],
"fully_quantize": [False, True],
},
]
def swap_last_two_dims(*args):
"""Return a tuple with the last two dimensions swapped."""
return args[:-2] + (args[-1],) + (args[-2],)
def build_graph(parameters):
"""Build a simple graph with Batc... |
combine_chunk_392251 | combine.txt | 392,251 | 512 | , max_value=1.0)
if rhs_constant:
output_values = sess.run(
outputs, feed_dict=dict(zip(inputs, [input0_value])))
return [input0_value], output_values
else:
input1_shape = parameters["shapes"][
3] if not adj_b else swap_last_two_dims(*parameters["shapes"][3])
input1_v... |
combine_chunk_392252 | combine.txt | 392,252 | 512 | 1000)],
},
{
"dtype": [tf.float32],
"input_shape": [[4, 7]],
"fully_quantize": [False, True],
"input_range": [(-1000, 1000)],
},
]
def build_graph(parameters):
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"], name="input", shap... |
combine_chunk_392253 | combine.txt | 392,253 | 512 | ],
},
# 1-D axis.
{
"input_dtype": [tf.float32, tf.int32],
"input_shape": [[2, 4, 5], [3, 8, 4]],
"shift": [[1], [-3], [5]],
"axis": [[0], [1], [2]],
},
# Multiple axis.
{
"input_dtype": [tf.float32, tf.int32],
"input_shape": [[2, 4, 5], [3, 8, 4]]... |
combine_chunk_392254 | combine.txt | 392,254 | 512 | shape]
def get_shape(param):
if np.isscalar(param):
return []
return [len(param)]
def get_value(param, dtype):
if np.isscalar(param):
return np.dtype(dtype).type(param)
return np.array(param).astype(dtype)
def build_graph(parameters):
input_tensor = tf.compat.v1.placeholder(
... |
combine_chunk_392255 | combine.txt | 392,255 | 512 | _of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_function()
def make_pad_tests(options):
"""Make a set of tests to do pad."""
# TODO(nupurgarg): Add test for tf.uint8.
test_parameters = [
# 5D:
{
"dtype": [tf.int32, tf.int64, tf.... |
combine_chunk_392256 | combine.txt | 392,256 | 512 | # 1D:
{
"dtype": [tf.int32, tf.bool],
"input_shape": [[1]],
"padding_dtype": [tf.int32, tf.int64],
"paddings": [[[1, 2]]],
"constant_paddings": [False],
"fully_quantize": [False],
"quant_16x8": [False],
},
# 4D:
{
"... |
combine_chunk_392257 | combine.txt | 392,257 | 512 | or constants.
if parameters["constant_paddings"]:
paddings = parameters["paddings"]
input_tensors = [input_tensor]
else:
shape = [len(parameters["paddings"]), 2]
paddings = tf.compat.v1.placeholder(
dtype=parameters["padding_dtype"], name="padding", shape=shape
)
i... |
combine_chunk_392258 | combine.txt | 392,258 | 512 | }]
def build_graph(parameters):
"""Build the range op testing graph."""
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"], name=("start"), shape=[])
if parameters["delta"] < 0:
offset = parameters["offset"] * -1
else:
offset = parameters["offset"]
delta = par... |
combine_chunk_392259 | combine.txt | 392,259 | 512 | return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
"""Build the inputs for the test case."""
input_values = create_tensor_data(
np.float32, parameters["input_shape"], min_value=-10, max_value=10)
# Inject NaN and Inf value.
def random_index(shape):
re... |
combine_chunk_392260 | combine.txt | 392,260 | 512 | input",
shape=parameters["input_shape"])
if parameters["constant_indices"]:
begin = parameters["begin"]
end = parameters["end"]
strides = parameters["strides"]
tensors = [input_tensor]
else:
begin = tf.compat.v1.placeholder(
dtype=parameters["index_type"],
... |
combine_chunk_392261 | combine.txt | 392,261 | 512 | _tf_failures)
@register_make_test_function()
def make_strided_slice_tests(options):
"""Make a set of tests to do strided_slice."""
# TODO(soroosh): add test/support for uint8.
test_parameters = [
# 4-D (basic cases with const/non-const indices).
{
"dtype": [tf.float32, tf.int32, tf.int64,... |
combine_chunk_392262 | combine.txt | 392,262 | 512 | _quantize": [False],
},
# 2-D
{
"dtype": [tf.float32],
"index_type": [tf.int32],
"input_shape": [[2, 3]],
"begin": [[0, 0]],
"end": [[2, 2]],
"strides": [None, [2, 2]],
"begin_mask": [None, 1, 2],
"end_mask": [None, 1, 2],... |
combine_chunk_392263 | combine.txt | 392,263 | 512 | , 5]],
"begin": [[0]],
"end": [[1]],
"strides": [None, [1]],
"begin_mask": [0],
"end_mask": [0],
"shrink_axis_mask": [1],
"constant_indices": [True],
"fully_quantize": [True],
},
{
"dtype": [tf.float32],
"ind... |
combine_chunk_392264 | combine.txt | 392,264 | 512 | 4, 5]],
"strides": [[1, 1, 1, 1]],
"begin_mask": [0, 8],
"end_mask": [0, 2],
"shrink_axis_mask": [0, 4],
"ellipsis_mask": [2, 4],
"new_axis_mask": [1, 6],
"constant_indices": [True],
"fully_quantize": [False],
},
{
"d... |
combine_chunk_392265 | combine.txt | 392,265 | 512 | 0], [1], [2]],
"end": [[-2], [-1], [0], [1], [2]],
"strides": [[-2], [-1], [1], [2]],
"begin_mask": [0, 1],
"end_mask": [0, 1],
"shrink_axis_mask": [0],
"constant_indices": [False],
},
]
_make_strided_slice_tests(options, test_parameters)
<|file|>te... |
combine_chunk_392266 | combine.txt | 392,266 | 512 | "block_shape": [[1, 1]],
"crops": [[[0, 0], [0, 0]], [[1, 1], [1, 1]]],
"constant_block_shape": [True],
"constant_crops": [True],
"dynamic_range_quantize": [True, False],
},
{
"dtype": [tf.float32],
"input_shape": [[1, 3, 3, 1]],
"block_... |
combine_chunk_392267 | combine.txt | 392,267 | 512 | ]
def build_graph(parameters):
"""Build a batch_to_space graph given `parameters`."""
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"],
name="input",
shape=parameters["input_shape"])
input_tensors = [input_tensor]
# Get block_shape either as a const or as a ... |
combine_chunk_392268 | combine.txt | 392,268 | 512 | # ==============================================================================
"""Test configs for hardswish."""
import functools
import numpy as np
import tensorflow as tf
from tensorflow.lite.python import lite
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_t... |
combine_chunk_392269 | combine.txt | 392,269 | 512 | = inp * tf.nn.relu6(inp + np.float32(3)) * np.float32(1. / 6.)
return [inp], [out]
def build_inputs(parameters, sess, inputs, outputs):
input_values = create_tensor_data(
np.float32, parameters["input_shape"], min_value=-10, max_value=10)
return [input_values], sess.run(
outputs, feed_d... |
combine_chunk_392270 | combine.txt | 392,270 | 512 | = tf.floor(input_value)
return [input_value], [out]
def build_inputs(parameters, sess, inputs, outputs):
input_value = create_tensor_data(parameters["input_dtype"],
parameters["input_shape"])
return [input_value], sess.run(outputs, feed_dict={inputs[0]: input_value})... |
combine_chunk_392271 | combine.txt | 392,271 | 512 | |file|>tensorflow/tensorflow/lite/testing/op_tests/strided_slice_np_style.py
# Copyright 2019 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_392272 | combine.txt | 392,272 | 512 | slice(1, 11, 3), Ellipsis,
slice(3, 7, 2)]],
},
# Ellipsis 4d.
{
"dtype": [tf.float32],
"shape": [[21, 15, 7, 9]],
"spec": [[slice(3, 7, 2), Ellipsis]],
},
# Ellipsis 5d.
{
"dtype": [tf.float32],
"shape": [[11, 21,... |
combine_chunk_392273 | combine.txt | 392,273 | 512 | "spec": [[Ellipsis, slice(3, 7, 2)]],
},
# Ellipsis + Shrink Mask
{
"dtype": [tf.float32],
"shape": [[22, 15, 7]],
"spec": [[
Ellipsis, # shrink after ellipsis
2
]],
},
]
def build_graph(parameters):
"""Build... |
combine_chunk_392274 | combine.txt | 392,274 | 512 | , -1],
"type": [tf.float32, tf.uint8, tf.int32, tf.int64],
"fully_quantize": [False],
"quant_16x8": [False],
"dynamic_range_quantize": [False],
}, {
"base_shape": [[1, 3, 4, 3], [3, 4], [2, 3, 4, 3]],
"num_tensors": [1, 2, 3, 4, 5, 6],
"axis": [1, 2, 3, -3, -2, -1],
"ty... |
combine_chunk_392275 | combine.txt | 392,275 | 512 | =("input%d" % n),
shape=get_shape(parameters, n))
all_tensors.append(input_tensor)
out = tf.concat(all_tensors, parameters["axis"])
return all_tensors, [out]
def build_inputs(parameters, sess, inputs, outputs):
all_values = []
for n in range(0, parameters["num_tensors"]):
input_... |
combine_chunk_392276 | combine.txt | 392,276 | 512 | .v1.placeholder(
dtype=parameters["element_dtype"],
shape=[parameters["num_elements"]] + parameters["element_shape"])
tensor_list = list_ops.tensor_list_from_tensor(data,
parameters["element_shape"])
tensor_list = list_ops.tensor_list_resize(ten... |
combine_chunk_392277 | combine.txt | 392,277 | 512 | _model_binary)
interpreter.allocate_tensors()
for op in interpreter._get_ops_details(): # pylint: disable=protected-access
if op["op_name"] == "GELU":
return result
raise RuntimeError("Expected to generate GELU op node in graph.")
@register_make_test_function()
def make_gelu_tests(options):
"""Make... |
combine_chunk_392278 | combine.txt | 392,278 | 512 | 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_392279 | combine.txt | 392,279 | 512 | 32, name="filter", shape=filter_shape)
input_tensors = [input_tensor, filter_input]
# Use `tf.nn.convolution` here since it will create the `batch_to_space` and
# the `space_to_batch` ops respectively.
out = tf.nn.convolution(
input=input_tensor,
filters=filter_input,
strides=... |
combine_chunk_392280 | combine.txt | 392,280 | 512 | [tf.float32, tf.int32],
"input_shape": [[2, 5, 3, 1]],
"num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [False],
},
{
"dtype": [tf.float32, tf.int32],
"input_shape": [[5]],
"num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [Fals... |
combine_chunk_392281 | combine.txt | 392,281 | 512 | ,
# 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 random_standard_normal."""
from __futur... |
combine_chunk_392282 | combine.txt | 392,282 | 512 | 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ex... |
combine_chunk_392283 | combine.txt | 392,283 | 512 | 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either... |
combine_chunk_392284 | combine.txt | 392,284 | 512 | outputs, feed_dict=dict(zip(inputs, input_values)))
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
<|file|>tensorflow/tensorflow/lite/testing/mlir_convert.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License... |
combine_chunk_392285 | combine.txt | 392,285 | 512 | izer = options.mlir_quantizer
if options.make_tf_ptq_tests:
if options.hlo_aware_conversion:
tf_quantization_mode = "DEFAULT"
else:
tf_quantization_mode = "LEGACY_INTEGER"
converter._experimental_tf_quantization_mode = tf_quantization_mode # pylint: disable=protected-access
if options.run_... |
combine_chunk_392286 | combine.txt | 392,286 | 512 | _type = (
extra_convert_options.inference_input_type)
if extra_convert_options.inference_output_type:
converter.inference_output_type = (
extra_convert_options.inference_output_type)
try:
tflite_model = converter.convert()
if options.expected_ops_in_converted_model:
ops_l... |
combine_chunk_392287 | combine.txt | 392,287 | 512 | _types = ",".join([x[2] for x in input_tensors])
cmd_list = [
bin_path,
"-tf-input-arrays=" + ",".join([x[0] for x in input_tensors]),
"-tf-input-data-types=" + input_types,
"-tf-input-shapes=" + input_shapes_str,
"-tf-output-arrays=" + ",".join(output_tensors),
]
if... |
combine_chunk_392288 | combine.txt | 392,288 | 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_392289 | combine.txt | 392,289 | 512 |
# value and creating non-device-specific graphs to export.
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
parser = argparse.ArgumentParser(description="Script to generate TFLite tests.")
parser.add_argument(
"output_path", help="Directory where the outputs will be go.")
parser.add_argument(
"--zip_to_output",
... |
combine_chunk_392290 | combine.txt | 392,290 | 512 |
options.zip_to_output = FLAGS.zip_to_output
options.known_bugs_are_errors = FLAGS.known_bugs_are_errors
options.ignore_converter_errors = FLAGS.ignore_converter_errors
options.save_graphdefs = FLAGS.save_graphdefs
options.run_with_flex = FLAGS.run_with_flex
options.make_edgetpu_tests = FLAGS.make_edgetpu_t... |
combine_chunk_392291 | combine.txt | 392,291 | 512 | which to put the html.
title: "Title of the zip file this pertains to."
reports: a list of conversion attempts. (report_args, report_vals) i.e.
({"shape": [1,2,3], "type": "tf.float32"},
{"tf": "SUCCESS", "tflite_converter": "FAILURE",
"tf_log": "", "tflite_converter_log": "Unsupported typ... |
combine_chunk_392292 | combine.txt | 392,292 | 512 | items.
fp.write("""
<body>
<h1>TensorFlow Lite Conversion</h1>
<h2>%s</h2>
""" % title)
# Get a list of keys that are in any of the records.
param_keys = {}
for params, _ in reports:
for k in params.keys():
param_keys[k] = True
fp.write("<table>\n")
fp.write("<tr><td class='horiz'>\n")
fp.wri... |
combine_chunk_392293 | combine.txt | 392,293 | 512 | 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS... |
combine_chunk_392294 | combine.txt | 392,294 | 512 | ()] = kv[1].strip()
else:
raise RuntimeError('Error parsing delegate option: ' + o)
# load external delegate
if args.ext_delegate is not None:
print('Loading external delegate from {} with args: {}'.format(
args.ext_delegate, ext_delegate_options))
ext_delegate = [
tflite.load... |
combine_chunk_392295 | combine.txt | 392,295 | 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_392296 | combine.txt | 392,296 | 512 | <|file|>tensorflow/tensorflow/lite/ios/extract_object_files_main.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
#
# http:... |
combine_chunk_392297 | combine.txt | 392,297 | 512 | in the BSD variant format used in Apple platforms.
See: https://en.wikipedia.org/wiki/Ar_(Unix)#BSD_variant
This extractor has two important differences compared to the 'ar -x' command
shipped with Xcode.
1. When there are multiple object files with the same name in a given archive,
each file is renamed so tha... |
combine_chunk_392298 | combine.txt | 392,298 | 512 | writing this file if the same file was already extracted.
elif extracted_files[final_name] == digest:
break
def _generate_modified_filenames(filename: str) -> Iterator[str]:
"""Generates the modified filenames with incremental name suffix added.
This helper function first yields the given filename... |
combine_chunk_392299 | combine.txt | 392,299 | 512 | != b'`\n':
raise RuntimeError('Invalid file header format.')
# Convert the bytes into more natural types.
name = name.decode('ascii').strip()
size = int(size, base=10)
odd_size = size % 2 == 1
# Handle the extended filename scheme.
if name.startswith('#1/'):
filename_size = int(na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.