Skip to content

Commit 18e0643

Browse files
authored
Adding cast to fp32 for TensorRT no image case (tensorflow#3917)
* Adding cast to fp32 * Adding myself to OWNERS
1 parent b6bcc45 commit 18e0643

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
/research/swivel/ @waterson
4040
/research/syntaxnet/ @calberti @andorardo @bogatyy @markomernick
4141
/research/tcn/ @coreylynch @sermanet
42+
/research/tensorrt/ @karmel
4243
/research/textsum/ @panyx0718 @peterjliu
4344
/research/transformer/ @daviddao
4445
/research/video_prediction/ @cbfinn

research/tensorrt/tensorrt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def batch_from_random(batch_size, output_height=224, output_width=224,
118118
[batch_size, output_height, output_width, num_channels]
119119
"""
120120
shape = [batch_size, output_height, output_width, num_channels]
121-
return np.random.random_sample(shape)
121+
# Make sure we return float32, as float64 will not get cast automatically.
122+
return np.random.random_sample(shape).astype(np.float32)
122123

123124

124125
################################################################################

0 commit comments

Comments
 (0)