MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / createRnnDescriptor

Method createRnnDescriptor

tensorflow/stream_executor/rocm/rocm_dnn.cc:2330–2359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2328}
2329
2330port::StatusOr<std::unique_ptr<dnn::RnnDescriptor>>
2331MIOpenSupport::createRnnDescriptor(
2332 int num_layers, int hidden_size, int input_size, int cell_size,
2333 int batch_size, dnn::RnnInputMode input_mode,
2334 dnn::RnnDirectionMode direction_mode, dnn::RnnMode rnn_mode,
2335 dnn::DataType data_type, const dnn::AlgorithmConfig& algorithm_config,
2336 float dropout, uint64 seed, ScratchAllocator* state_allocator,
2337 bool use_padded_io) {
2338 // ROCM TODO: cell_size is used to decide hidden size when output project
2339 // is supported.
2340 // ROCM TODO: batch_size is used in dynamic persistent RNN algorithm and is
2341 // not supported by MIOpen now.
2342 if (use_padded_io) {
2343 return port::Status(port::error::INVALID_ARGUMENT,
2344 "MIOpen only supports packed input output.");
2345 }
2346
2347 auto miopen = miopen_->GetHandle(parent_, nullptr);
2348 std::unique_ptr<MIOpenRnnDescriptor> rnn_desc(new MIOpenRnnDescriptor(
2349 miopen.handle(), num_layers, hidden_size, input_size,
2350 ToMIOpenRnnInputMode(input_mode),
2351 ToMIOpenRnnDirectionMode(direction_mode), ToMIOpenRnnMode(rnn_mode),
2352 ToMIOpenDataType(data_type), dropout, seed, algorithm_config,
2353 state_allocator));
2354 if (!rnn_desc->ok()) {
2355 return rnn_desc->Status();
2356 }
2357 return port::StatusOr<std::unique_ptr<dnn::RnnDescriptor>>(
2358 std::move(rnn_desc));
2359}
2360
2361port::StatusOr<std::unique_ptr<dnn::RnnSequenceTensorDescriptor>>
2362MIOpenSupport::createRnnSequenceTensorDescriptor(int seq_length, int batch_size,

Callers

nothing calls this directly

Calls 9

ToMIOpenRnnInputModeFunction · 0.85
ToMIOpenRnnDirectionModeFunction · 0.85
ToMIOpenRnnModeFunction · 0.85
ToMIOpenDataTypeFunction · 0.85
StatusEnum · 0.50
GetHandleMethod · 0.45
handleMethod · 0.45
okMethod · 0.45
StatusMethod · 0.45

Tested by

no test coverage detected