[tf.data] Avoid creating and destroying unused tensor in RangeDataset iterator.
PiperOrigin-RevId: 299221519 Change-Id: I87d11cbafd07be4bfd9218bc575b52a5c29daf0a
This commit is contained in:
parent
44506a0e68
commit
e0857cc6da
@ -107,7 +107,6 @@ class RangeDatasetOp::Dataset : public DatasetBase {
|
||||
return Status::OK();
|
||||
}
|
||||
out_tensors->reserve(1);
|
||||
Tensor result(dataset()->output_dtypes()[0]);
|
||||
switch (dataset()->output_dtypes()[0]) {
|
||||
#define HANDLE_TYPE(type) \
|
||||
case DataTypeToEnum<type>::value: { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user