MCPcopy Create free account
hub / github.com/tensorflow/models / build_inputs

Method build_inputs

official/modeling/multitask/evaluator_test.py:60–74  ·  view source on GitHub ↗
(self, params)

Source from the content-addressed store, hash-verified

58 return [tf_keras.metrics.Accuracy(name="acc")]
59
60 def build_inputs(self, params):
61
62 def generate_data(_):
63 x = tf.zeros(shape=(2,), dtype=tf.float32)
64 label = tf.zeros([1], dtype=tf.int32)
65 if self.name == "bar":
66 return dict(x=x, y=x), label
67 else:
68 return dict(x=x), label
69
70 dataset = tf.data.Dataset.range(1)
71 dataset = dataset.repeat()
72 dataset = dataset.map(
73 generate_data, num_parallel_calls=tf.data.experimental.AUTOTUNE)
74 return dataset.prefetch(buffer_size=1).batch(2, drop_remainder=True)
75
76 def validation_step(self, inputs, model: tf_keras.Model, metrics=None):
77 logs = super().validation_step(inputs, model, metrics)

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected