Commit 4ff8a292 authored by Khalique Ahmed's avatar Khalique Ahmed
Browse files

revert auto_cont

parent ef3a45c2
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "migraphx/instruction_ref.hpp"
#include <migraphx/auto_contiguous.hpp> #include <migraphx/auto_contiguous.hpp>
#include <migraphx/program.hpp> #include <migraphx/program.hpp>
#include <migraphx/instruction.hpp> #include <migraphx/instruction.hpp>
...@@ -65,24 +64,12 @@ void auto_contiguous::apply(module& m) const ...@@ -65,24 +64,12 @@ void auto_contiguous::apply(module& m) const
// for last instruction that is NOT a return // for last instruction that is NOT a return
if(ins->outputs().empty() and ins != last) if(ins->outputs().empty() and ins != last)
continue; continue;
if(ins->name() == "pooling" or ins->name() == "dot") shape s = ins->get_shape();
if(not s.dynamic() and not s.standard() and s.elements() != 0)
{ {
// auto c = m.insert_instruction(ins, make_op("contiguous"), ins); auto c = m.insert_instruction(std::next(ins), make_op("contiguous"), ins);
std::vector<instruction_ref> new_args; m.replace_instruction(ins, c);
for(auto args : ins->inputs())
{
new_args.push_back(m.insert_instruction(ins, make_op("contiguous"), args));
}
auto op = m.insert_instruction(ins, ins->get_operator(), new_args);
m.replace_instruction(ins, op);
} }
// shape s = ins->get_shape();
// if(not s.dynamic() and
// not s.standard() and s.elements() != 0)
// {
// auto c = m.insert_instruction(std::next(ins), make_op("contiguous"), ins);
// m.replace_instruction(ins, c);
// }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment