Updated examples/ to use tstring.
This is a part of a larger migration effort for tensorflow::tstring. See: https://github.com/tensorflow/community/pull/91 PiperOrigin-RevId: 263055479
This commit is contained in:
parent
56bd72ef65
commit
f05a57eefe
@ -60,10 +60,11 @@ limitations under the License.
|
||||
|
||||
// These are all common classes it's handy to reference with no namespace.
|
||||
using tensorflow::Flag;
|
||||
using tensorflow::Tensor;
|
||||
using tensorflow::int32;
|
||||
using tensorflow::Status;
|
||||
using tensorflow::string;
|
||||
using tensorflow::int32;
|
||||
using tensorflow::Tensor;
|
||||
using tensorflow::tstring;
|
||||
|
||||
// Takes a file name, and loads a list of labels from it, one per line, and
|
||||
// returns a vector of the strings. It pads with empty strings so the length
|
||||
@ -106,7 +107,7 @@ static Status ReadEntireFile(tensorflow::Env* env, const string& filename,
|
||||
"' expected ", file_size, " got ",
|
||||
data.size());
|
||||
}
|
||||
output->scalar<string>()() = string(data);
|
||||
output->scalar<tstring>()() = tstring(data);
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,11 @@ limitations under the License.
|
||||
|
||||
// These are all common classes it's handy to reference with no namespace.
|
||||
using tensorflow::Flag;
|
||||
using tensorflow::Status;
|
||||
using tensorflow::Tensor;
|
||||
using tensorflow::int32;
|
||||
using tensorflow::Status;
|
||||
using tensorflow::string;
|
||||
using tensorflow::Tensor;
|
||||
using tensorflow::tstring;
|
||||
|
||||
namespace {
|
||||
|
||||
@ -149,7 +150,7 @@ int main(int argc, char* argv[]) {
|
||||
return -1;
|
||||
}
|
||||
Tensor wav_tensor(tensorflow::DT_STRING, tensorflow::TensorShape({}));
|
||||
wav_tensor.scalar<string>()() = wav_string;
|
||||
wav_tensor.scalar<tstring>()() = wav_string;
|
||||
|
||||
// Actually run the audio through the model.
|
||||
std::vector<Tensor> outputs;
|
||||
|
Loading…
Reference in New Issue
Block a user