- 
                Notifications
    You must be signed in to change notification settings 
- Fork 112
Lower lrn to pooling #4294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Lower lrn to pooling #4294
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            69 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      165869d
              
                Adding lower_lrn_to_pooling function
              
              
                aarushjain29 65d5b70
              
                Adding lower_lrn_to_pooling function
              
              
                aarushjain29 83651ec
              
                Adding invert permutation header
              
              
                aarushjain29 75d6370
              
                changes in apply
              
              
                aarushjain29 6d94d79
              
                Update src/rewrite_pooling.cpp
              
              
                aarushjain29 acafcc0
              
                Merge branch 'develop' into lower-lrn-to-pooling
              
              
                aarushjain29 0b717ab
              
                test case added
              
              
                aarushjain29 bec9dac
              
                test case added
              
              
                aarushjain29 ea39019
              
                more test case
              
              
                aarushjain29 8b36261
              
                Merge branch 'develop' into lower-lrn-to-pooling
              
              
                aarushjain29 69efb32
              
                remove comment
              
              
                aarushjain29 fb8b708
              
                remove spaces
              
              
                aarushjain29 6dae737
              
                Update test/rewrite_pooling_test.cpp
              
              
                aarushjain29 09ef691
              
                Update test/rewrite_pooling_test.cpp
              
              
                aarushjain29 6ac18ee
              
                tidy errors
              
              
                aarushjain29 4780e5e
              
                cpp errors
              
              
                aarushjain29 3858f86
              
                tidy errors
              
              
                aarushjain29 2c1b76f
              
                tidy errors
              
              
                aarushjain29 07a2730
              
                test case for comparing two models
              
              
                aarushjain29 c2dc92b
              
                test case for comparing two models
              
              
                aarushjain29 ea7159d
              
                accepting both even and odd sizes
              
              
                aarushjain29 cc383cd
              
                remove tidy errors
              
              
                aarushjain29 6d17986
              
                remove tidy errors
              
              
                aarushjain29 506e2e6
              
                tidy error
              
              
                aarushjain29 6e5597d
              
                formatting
              
              
                aarushjain29 393e613
              
                formatting
              
              
                aarushjain29 38a39c2
              
                license
              
              
                aarushjain29 2b6cc85
              
                formatting
              
              
                aarushjain29 d4d5452
              
                reverting back to even size
              
              
                aarushjain29 5a783c9
              
                logic for both evenn and odd sizes
              
              
                aarushjain29 02a7ce7
              
                calculate padding
              
              
                aarushjain29 84d2105
              
                formatting
              
              
                aarushjain29 f4df624
              
                formatting
              
              
                aarushjain29 89fc424
              
                formatting
              
              
                aarushjain29 e489de0
              
                test case added
              
              
                aarushjain29 b0335f2
              
                verify test case
              
              
                aarushjain29 77ca91d
              
                formatting
              
              
                aarushjain29 2043239
              
                Merge branch 'develop' into lower-lrn-to-pooling
              
              
                aarushjain29 e8c2547
              
                Update test/rewrite_pooling_test.cpp
              
              
                aarushjain29 32821aa
              
                licensing
              
              
                aarushjain29 50b429f
              
                combine line 89 and 90
              
              
                aarushjain29 5e51bc1
              
                compiler warning unused param
              
              
                aarushjain29 e0355c5
              
                remove transposed lens
              
              
                aarushjain29 b8fc4ee
              
                Adding the check for size and combining all the checks in if
              
              
                aarushjain29 1b073b9
              
                changing the test to simplify_algebra like test
              
              
                aarushjain29 72934da
              
                tidy error
              
              
                aarushjain29 ea31d5e
              
                tidy error
              
              
                aarushjain29 3d7b480
              
                tidy error
              
              
                aarushjain29 080ac81
              
                tidy error
              
              
                aarushjain29 85c15cd
              
                Merge branch 'develop' into lower-lrn-to-pooling
              
              
                aarushjain29 91eb3c7
              
                remove try catch and add all conditions
              
              
                aarushjain29 a351f31
              
                formatting
              
              
                aarushjain29 310c8e7
              
                new tests added
              
              
                aarushjain29 8745a74
              
                removing test case from test_relu_lrn
              
              
                aarushjain29 808a56e
              
                MIGRAPHX_REWRITE_LRN flag
              
              
                aarushjain29 355bec1
              
                license
              
              
                aarushjain29 6d8929f
              
                formatting
              
              
                aarushjain29 c69157a
              
                formatting
              
              
                aarushjain29 1dadd05
              
                formatting
              
              
                aarushjain29 f5318f2
              
                license
              
              
                aarushjain29 a546fd4
              
                enable flag in test case
              
              
                aarushjain29 afabc81
              
                test case accepting flag
              
              
                aarushjain29 8b17b1d
              
                formatting
              
              
                aarushjain29 2e244c5
              
                formatting
              
              
                aarushjain29 878b135
              
                simplify code
              
              
                aarushjain29 04a7705
              
                simplify code
              
              
                aarushjain29 7ef1891
              
                Merge branch 'develop' into lower-lrn-to-pooling
              
              
                aarushjain29 526e25e
              
                updated the doc
              
              
                aarushjain29 c7cf3ee
              
                remove flag in test and formatting
              
              
                aarushjain29 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
          Some comments aren't visible on the classic Files Changed page.
        
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * The MIT License (MIT) | ||
| * | ||
| * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
|  | ||
| #include "verify_program.hpp" | ||
| #include <migraphx/program.hpp> | ||
| #include <migraphx/generate.hpp> | ||
| #include <migraphx/make_op.hpp> | ||
|  | ||
| template <int ChannelSize, int LrnSize> | ||
| struct test_lrn : verify_program<test_lrn<ChannelSize, LrnSize>> | ||
| { | ||
| migraphx::program create_program() const | ||
| { | ||
| migraphx::program p; | ||
| auto* mm = p.get_main_module(); | ||
| auto x = mm->add_parameter( | ||
| "x", migraphx::shape{migraphx::shape::float_type, {1, ChannelSize, 28, 28}}); | ||
| mm->add_instruction( | ||
| migraphx::make_op( | ||
| "lrn", {{"alpha", 0.0001}, {"beta", 0.75}, {"bias", 1.0}, {"size", LrnSize}}), | ||
| x); | ||
| return p; | ||
| } | ||
| }; | ||
|  | ||
| template struct test_lrn<32, 6>; | ||
| template struct test_lrn<32, 5>; | ||
| template struct test_lrn<31, 8>; | ||
| template struct test_lrn<31, 5>; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.