PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #2
You trained a text classification model. You have the following SignatureDefs: You started a TensorFlow-serving component server and tried to send an HTTP request to get a prediction using: headers =
The correct answer is D. data = json.dumps({"signature_name": "serving_default", "instances" [[`a', `b'], [`c', `d'], [`e', `f']]}). A negative number in the shape enables auto expand (https://stackoverflow.com/questions/37956197/what-is-the-negative-index-in-shape-arrays-used- for-tensorflow). Then the first number -1 out of the shape (-1, 2) speaks the number of 1 dimensional arrays within the tensor (and it
Question
Exhibit
Options
- Adata = json.dumps({"signature_name": "seving_default", "instances" [[
ab',bc', `cd']]}) - Bdata = json.dumps({"signature_name": "serving_default", "instances" [[
a',b',c',d',e',f']]}) - Cdata = json.dumps({"signature_name": "serving_default", "instances" [[
a',b',c'], [d',e',f']]}) - Ddata = json.dumps({"signature_name": "serving_default", "instances" [[
a',b'], [c',d'], [e',f']]})
How the community answered
(36 responses)- A3% (1)
- B11% (4)
- C6% (2)
- D81% (29)
Explanation
A negative number in the shape enables auto expand (https://stackoverflow.com/questions/37956197/what-is-the-negative-index-in-shape-arrays-used- for-tensorflow). Then the first number -1 out of the shape (-1, 2) speaks the number of 1 dimensional arrays within the tensor (and it can autoexpand) while the second numer (2) sets the number of elements in the inner array at 2.
Topics
Community Discussion
No community discussion yet for this question.
