| 2328 | } |
| 2329 | |
| 2330 | port::StatusOr<std::unique_ptr<dnn::RnnDescriptor>> |
| 2331 | MIOpenSupport::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 | |
| 2361 | port::StatusOr<std::unique_ptr<dnn::RnnSequenceTensorDescriptor>> |
| 2362 | MIOpenSupport::createRnnSequenceTensorDescriptor(int seq_length, int batch_size, |
nothing calls this directly
no test coverage detected