Home
last modified time | relevance | path

Searched refs:tf (Results 1 – 25 of 70) sorted by relevance

123

/AliOS-Things-master/solutions/tflite_micro_speech_demo/micro_speech/train/speech_commands/
A Dmodels.py24 import tensorflow as tf namespace
160 saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables())
190 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
256 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
380 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
398 first_conv = tf.nn.conv2d(
518 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
713 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
731 first_conv = tf.nn.conv2d(
818 dropout_rate = tf.compat.v1.placeholder(tf.float32, name='dropout_rate')
[all …]
A Dinput_data.py33 import tensorflow as tf namespace
127 with tf.compat.v1.Session(graph=tf.Graph()) as sess:
128 wav_filename_placeholder = tf.compat.v1.placeholder(tf.string, [])
144 with tf.compat.v1.Session(graph=tf.Graph()) as sess:
145 wav_filename_placeholder = tf.compat.v1.placeholder(tf.string, [])
146 sample_rate_placeholder = tf.compat.v1.placeholder(tf.int32, [])
147 wav_data_placeholder = tf.compat.v1.placeholder(tf.float32, [None, 1])
355 with tf.compat.v1.Session(graph=tf.Graph()) as sess:
472 int16_input = tf.cast(tf.multiply(background_clamp, 32768), tf.int16)
484 tf.expand_dims(tf.expand_dims(self.output_, -1), 0),
[all …]
A Dtrain.py79 import tensorflow as tf namespace
93 sess = tf.compat.v1.InteractiveSession()
168 with tf.compat.v1.name_scope('train'), tf.control_dependencies(
186 evaluation_step = tf.reduce_mean(input_tensor=tf.cast(correct_prediction,
195 saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables())
254 tf.compat.v1.logging.debug(
260 tf.compat.v1.logging.info(
490 return tf.compat.v1.logging.DEBUG
492 return tf.compat.v1.logging.INFO
494 return tf.compat.v1.logging.WARN
[all …]
A Dfreeze.py45 import tensorflow as tf namespace
96 wav_data_placeholder = tf.compat.v1.placeholder(tf.string, [],
98 decoded_sample_data = tf.audio.decode_wav(
110 fingerprint_input = tf.nn.pool(
133 int16_input = tf.cast(
134 tf.multiply(decoded_sample_data.audio, 32767), tf.int16)
142 out_type=tf.float32)
168 tf.io.write_graph(
214 _ = tf.contrib
224 sess = tf.compat.v1.InteractiveSession()
[all …]
A Dtest_streaming_accuracy.py70 import tensorflow as tf namespace
82 graph = tf.Graph()
84 od_graph_def = tf.compat.v1.GraphDef()
85 with tf.io.gfile.GFile(mode_file, 'rb') as fid:
88 tf.import_graph_def(od_graph_def, name='')
103 with tf.compat.v1.Session(graph=tf.Graph()) as sess:
104 wav_filename_placeholder = tf.compat.v1.placeholder(tf.string, [])
135 with tf.compat.v1.Session() as sess:
172 tf.compat.v1.logging.error(
175 tf.compat.v1.logging.info('{}ms {}:{}{}'.format(
[all …]
A Dlabel_wav.py37 import tensorflow as tf namespace
45 with tf.io.gfile.GFile(filename, 'rb') as f:
46 graph_def = tf.compat.v1.GraphDef()
48 tf.import_graph_def(graph_def, name='')
53 return [line.rstrip() for line in tf.io.gfile.GFile(filename)]
59 with tf.compat.v1.Session() as sess:
79 if not wav or not tf.io.gfile.exists(wav):
81 if not labels or not tf.io.gfile.exists(labels):
84 if not graph or not tf.io.gfile.exists(graph):
129 tf.compat.v1.app.run(main=main, argv=[sys.argv[0]] + unparsed)
A Dlabel_wav_dir.py38 import tensorflow as tf namespace
46 with tf.io.gfile.GFile(filename, 'rb') as f:
47 graph_def = tf.compat.v1.GraphDef()
49 tf.import_graph_def(graph_def, name='')
54 return [line.rstrip() for line in tf.io.gfile.GFile(filename)]
60 with tf.compat.v1.Session() as sess:
66 if not wav_path or not tf.io.gfile.exists(wav_path):
87 if not labels or not tf.io.gfile.exists(labels):
90 if not graph or not tf.io.gfile.exists(graph):
132 tf.compat.v1.app.run(main=main, argv=[sys.argv[0]] + unparsed)
A Dlabel_wav_test.py23 import tensorflow as tf namespace
33 sample_data = tf.zeros([1000, 2])
34 wav_encoder = tf.audio.encode_wav(sample_data, 16000)
50 with tf.compat.v1.Session() as sess:
51 tf.compat.v1.placeholder(tf.string, name=input_name)
52 tf.zeros([1, 3], name=output_name)
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/experimental/mlir/testing/op_tests/
A Dwhere_v2.py20 import tensorflow.compat.v1 as tf namespace
33 "input_dtype": [tf.float32, tf.int32],
38 "input_dtype": [tf.float32, tf.int32],
43 "input_dtype": [tf.float32, tf.int32],
48 "input_dtype": [tf.float32, tf.int32],
53 "input_dtype": [tf.float32, tf.int32],
58 "input_dtype": [tf.float32, tf.int32],
63 "input_dtype": [tf.float32, tf.int32],
68 "input_dtype": [tf.float32, tf.int32],
76 dtype=tf.bool,
[all …]
A Dparse_example.py23 import tensorflow.compat.v1 as tf namespace
33 if feature_dtype in (tf.float32, tf.float16, tf.float64):
35 features["x"] = tf.train.Feature(
37 elif feature_dtype in (tf.int32, tf.uint8, tf.int64, tf.int16):
39 features["x"] = tf.train.Feature(
41 elif feature_dtype == tf.string:
44 features["x"] = tf.train.Feature(
46 example = tf.train.Example(features=tf.train.Features(feature=features))
56 "feature_dtype": [tf.string, tf.float32, tf.int64],
66 input_value = tf.compat.v1.placeholder(
[all …]
A Dbroadcast_to.py20 import tensorflow as tf namespace
32 "input_dtype": [tf.float32, tf.int32],
37 "input_dtype": [tf.float32, tf.int32],
41 "input_dtype": [tf.float32, tf.int32],
45 "input_dtype": [tf.float32, tf.int32],
52 input_tensor = tf.compat.v1.placeholder(
57 out = tf.broadcast_to(input_tensor, shape=parameters["output_shape"])
A Dstatic_hashtable.py20 import tensorflow.compat.v1 as tf namespace
33 "table": [(tf.string, tf.int64, ["1", "2", "3"], [4, 5, 6], -1),
34 (tf.int64, tf.string, [1, 2, 3], ["4", "5", "6"], "-1")],
42 key_tensor = tf.constant(keys, dtype=key_dtype)
43 value_tensor = tf.constant(values, dtype=value_dtype)
45 initializer = tf.lookup.KeyValueTensorInitializer(key_tensor, value_tensor)
46 table = tf.lookup.StaticHashTable(initializer, default_value)
48 with tf.control_dependencies([tf.initializers.tables_initializer()]):
49 input_value = tf.compat.v1.placeholder(
A Dwhile_loop.py21 import tensorflow.compat.v1 as tf namespace
36 "dtype": [tf.int32],
40 "dtype": [tf.string],
49 num_iterations = tf.placeholder(
50 dtype=tf.int32, name="num_iterations", shape=(1,))
51 increment_value = tf.placeholder(
53 num_iterations_scalar = tf.reshape(num_iterations, ())
69 if parameters["dtype"] == tf.string:
72 new_value = tf.fill([1], tf.reshape(increment_value, ()))
77 counter, value, result_increment_value = tf.while_loop(
A Dcontrol_dep.py20 import tensorflow.compat.v1 as tf namespace
37 input_tensor = tf.compat.v1.placeholder(
38 dtype=tf.float32, name="input", shape=parameters["input_shape"])
39 filter_value = tf.zeros((3, 3, TEST_INPUT_DEPTH, 8), tf.float32)
40 assert_op = tf.compat.v1.assert_greater_equal(input_tensor,
42 with tf.control_dependencies([assert_op]):
43 out = tf.nn.conv2d(
48 input_values = create_tensor_data(tf.float32, parameters["input_shape"])
A Dcond.py21 import tensorflow.compat.v1 as tf namespace
38 "dtype": [tf.float32, tf.string],
44 input1 = tf.placeholder(dtype=parameters["dtype"], shape=(1,))
45 input2 = tf.placeholder(dtype=parameters["dtype"], shape=(1,))
50 pred = tf.placeholder(dtype=tf.bool, shape=(1,))
51 pred_scalar = tf.reshape(pred, ())
53 out = tf.cond(pred_scalar, lambda: input1, lambda: input2)
A Dstatic_rnn_with_control_flow_v2.py20 import tensorflow.compat.v1 as tf namespace
35 "dtype": [tf.float32],
53 one_timestamp_input = tf.placeholder(
58 lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(
59 num_cells, activation=tf.nn.relu, state_is_tuple=True)
70 dtype=tf.float32,
78 with tf.variable_scope("", reuse=True):
79 kernel = tf.get_variable("rnn/basic_lstm_cell/kernel")
80 bias = tf.get_variable("rnn/basic_lstm_cell/bias")
86 sess.run(tf.group(kernel.assign(kernel_values), bias.assign(bias_values)))
A Dtensor_list_dynamic_shape.py20 import tensorflow.compat.v1 as tf namespace
33 "element_dtype": [tf.float32, tf.int32],
41 item = tf.placeholder(
52 new_item = tf.add(
53 tf.add(item, item),
54 tf.constant(value=1, dtype=parameters["element_dtype"]))
58 _, tensor_list = tf.while_loop(condition, loop_body, init_state)
A Dcomplex_abs.py20 import tensorflow.compat.v1 as tf namespace
32 "dtype": [tf.complex64],
34 "Tout": [tf.float32]
36 "dtype": [tf.complex128],
38 "Tout": [tf.float64]
42 input_tensor = tf.compat.v1.placeholder(
46 out = tf.raw_ops.ComplexAbs(x=input_tensor, Tout=parameters["Tout"])
A Dsegment_sum.py20 import tensorflow.compat.v1 as tf namespace
33 "data_dtype": [tf.float32, tf.int32],
41 data = tf.compat.v1.placeholder(
45 segment_ids = tf.constant(parameters["segment_ids"], dtype=tf.int32)
46 out = tf.segment_sum(data, segment_ids)
A Ddense_image_warp.py20 import tensorflow as tf namespace
40 input_tensor = tf.compat.v1.placeholder(
41 dtype=tf.float32, name='input', shape=parameters['input_size'])
42 flow_tensor = tf.compat.v1.placeholder(
43 dtype=tf.float32, name='flow', shape=parameters['flow_size'])
50 tf.float32, parameters['input_size'], min_value=-10, max_value=10),
52 tf.float32, parameters['flow_size'], min_value=-10, max_value=10)
A Dreciprocal.py20 import tensorflow.compat.v1 as tf namespace
32 "input_dtype": [tf.float32, tf.int32, tf.int64],
38 input_tensor = tf.compat.v1.placeholder(
43 out = tf.math.reciprocal(input_tensor)
A Dconv_bias_activation.py21 import tensorflow.compat.v1 as tf namespace
68 @tf.function(jit_compile=True)
70 out = tf.nn.conv2d(
81 out = tf.nn.bias_add(data_input, bias_input, data_format="NHWC")
87 input_tensor = tf.compat.v1.placeholder(
88 dtype=tf.float32, name="input", shape=input_shape)
97 out = tf.nn.conv2d(
115 out = tf.nn.conv2d(
149 return make_conv_bias_activation_tests(tf.nn.relu6)(options)
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/micro/testing/
A Dgenerate_test_models.py31 import tensorflow as tf namespace
42 model = tf.keras.models.Sequential()
45 model.add(tf.keras.layers.Conv2D(32, 3, activation="relu"))
46 model.add(tf.keras.layers.MaxPooling2D(2))
47 model.add(tf.keras.layers.Flatten())
48 model.add(tf.keras.layers.Dense(10))
63 converter = tf.lite.TFLiteConverter.from_keras_model(model)
64 converter.optimizations = [tf.lite.Optimize.DEFAULT]
65 converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
66 converter.inference_input_type = tf.int8
[all …]
/AliOS-Things-master/components/SDL2/src/image/external/tiff-4.0.9/libtiff/
A Dtif_aux.c97 tf[0] = tf[1] = tf[2] = 0; in TIFFDefaultTransferFunction()
104 if (tf[0] == NULL) in TIFFDefaultTransferFunction()
106 tf[0][0] = 0; in TIFFDefaultTransferFunction()
114 if(tf[1] == NULL) in TIFFDefaultTransferFunction()
116 _TIFFmemcpy(tf[1], tf[0], nbytes); in TIFFDefaultTransferFunction()
120 _TIFFmemcpy(tf[2], tf[0], nbytes); in TIFFDefaultTransferFunction()
125 if (tf[0]) in TIFFDefaultTransferFunction()
126 _TIFFfree(tf[0]); in TIFFDefaultTransferFunction()
127 if (tf[1]) in TIFFDefaultTransferFunction()
129 if (tf[2]) in TIFFDefaultTransferFunction()
[all …]
/AliOS-Things-master/components/ai_agent/src/engine/tflite-micro/tensorflow/lite/experimental/microfrontend/python/kernel_tests/
A Daudio_microfrontend_op_test.py21 import tensorflow as tf namespace
43 audio = tf.constant(
45 tf.int16)
61 audio = tf.constant(
63 tf.int16)
82 audio = tf.constant(
84 tf.int16)
104 tf.int16)
126 tf.int16)
146 tf.int16)
[all …]

Completed in 26 milliseconds

123