Skip to content

Commit

Permalink
fix formatting and L0 copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkyang-nvi authored and mc-nv committed Jul 21, 2022
1 parent f15f0a2 commit 5fdd7b0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
41 changes: 24 additions & 17 deletions qa/L0_tf_parameters/tf_parameter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,40 @@


class TFParameterTest(tu.TestResultCollector):

def setUp(self):
self._client = tritonhttpclient.InferenceServerClient("localhost:8000", verbose=True)
self._client = tritonhttpclient.InferenceServerClient("localhost:8000",
verbose=True)

def _infer_helper(self):
# The model has a single variable which is added to the input. Since the
# variable is initialized to zero the input and output must match.
model_name = 'graphdef_variable'
input = np.array([10], dtype=np.int32)
# The model has a single variable which is added to the input. Since the
# variable is initialized to zero the input and output must match.
model_name = 'graphdef_variable'
input = np.array([10], dtype=np.int32)

inputs = []
inputs.append(tritonhttpclient.InferInput('INPUT', input.shape, 'INT32'))
inputs[-1].set_data_from_numpy(input)
inputs = []
inputs.append(tritonhttpclient.InferInput('INPUT', input.shape,
'INT32'))
inputs[-1].set_data_from_numpy(input)

outputs = []
outputs.append(tritonhttpclient.InferRequestedOutput('OUTPUT'))
outputs = []
outputs.append(tritonhttpclient.InferRequestedOutput('OUTPUT'))

results = self._client.infer(model_name=model_name, inputs=inputs, outputs=outputs)
output = results.as_numpy('OUTPUT')
np.testing.assert_array_equal(output, input)
results = self._client.infer(model_name=model_name,
inputs=inputs,
outputs=outputs)
output = results.as_numpy('OUTPUT')
np.testing.assert_array_equal(output, input)

def test_tf_variable(self):
self._infer_helper()
self._infer_helper()

def test_tf_variable_error(self):
with self.assertRaises(tritonclient.utils.InferenceServerException) as e:
self._infer_helper()
self.assertIn("Attempting to use uninitialized value VARIABLE", e.exception.message())
with self.assertRaises(
tritonclient.utils.InferenceServerException) as e:
self._infer_helper()
self.assertIn("Attempting to use uninitialized value VARIABLE",
e.exception.message())


if __name__ == '__main__':
Expand Down
5 changes: 4 additions & 1 deletion qa/common/check_copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
'qa/L0_model_config/noautofill_platform',
'qa/L0_model_config/autofill_noplatform',
'qa/L0_model_config/autofill_noplatform_success',
'qa/L0_model_config/special_cases', 'qa/L0_perf_nomodel/baseline',
'qa/L0_model_config/special_cases',
'qa/L0_model_config/cli_messages/cli_override/expected',
'qa/L0_model_config/cli_messages/cli_deprecation/expected',
'qa/L0_perf_nomodel/baseline',
'qa/L0_perf_nomodel/legacy_baseline', 'qa/L0_warmup/raw_mug_data',
'qa/L0_java_resnet/expected_output_data', 'TRITON_VERSION')

Expand Down

0 comments on commit 5fdd7b0

Please sign in to comment.