04d0a9bbfc085d244ee5abed1e4591202a8bd4cb,web/minstServingHandler.py,,do_inference,#Any#Any#,130
Before Change
print(host, port)
// 创建 python grpc 代码调用。
channel = implementations.insecure_channel(host, int(port))
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel)
request = predict_pb2.PredictRequest()
request.model_spec.name = "mnist"
request.model_spec.signature_name = "predict_images"
// image, label = test_data_set.next_batch(1)
After Change
prediction = ""
exception = result_future.exception()
if exception:
prediction = str(exception)
print(exception)
else:
sys.stdout.write(".")
sys.stdout.flush()
response = numpy.array(
result_future.result().outputs["scores"].float_val)
// print("response:\n",result_future.result())
prediction = str(numpy.argmax(response))
print("////////////////////////", prediction)
return prediction
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: pythonstock/stock
Commit Name: 04d0a9bbfc085d244ee5abed1e4591202a8bd4cb
Time: 2017-10-26
Author: yhy
File Name: web/minstServingHandler.py
Class Name:
Method Name: do_inference
Project Name: YerevaNN/mimic3-benchmarks
Commit Name: ba4a47663778725cdb3aeb0d18777695b76fbacf
Time: 2017-12-18
Author: harhro@gmail.com
File Name: mimic3models/rerun.py
Class Name:
Method Name: process_single
Project Name: lebedov/scikit-cuda
Commit Name: d632bed2770cda8f06d27690b3745237a558fd29
Time: 2014-08-25
Author: lev@columbia.edu
File Name: scikits/cuda/cublas.py
Class Name: _cublas_version_req
Method Name: __init__
Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: 6d27701311a5d0f013cf608dc5947e2fd0813882
Time: 2020-05-04
Author: sioni.summers10@imperial.ac.uk
File Name: hls4ml/model/hls_model.py
Class Name: WeightVariable
Method Name: update_precision