You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/08 20:49:16 UTC

[GitHub] taliesinb commented on issue #12760: Extremely weird shape inference bug in foreach

taliesinb commented on issue #12760: Extremely weird shape inference bug in foreach
URL: https://github.com/apache/incubator-mxnet/issues/12760#issuecomment-427974399
 
 
   Here's a simpler problem that I believe is the same issue:
   
   ```
   import mxnet as mx
   
   json = """{
   	"nodes":[
   		{
   			"op":"null",
   			"name":"a",
   			"attrs":{},
   			"inputs":[]
   		},
   		{
   			"op":"null",
   			"name":"b",
   			"attrs":{},
   			"inputs":[]
   		},
   		{
   			"op":"_foreach",
   			"name":"foreach",
   			"attrs":{
   				"in_data_locs":"[0,1]",
   				"in_state_locs":"[]",
   				"num_args":"3",
   				"num_out_data":"2",
   				"num_outputs":"2",
   				"remain_locs":"[]"
   			},
   			"inputs":[[0,0,0],[1,0,0]],
   			"subgraphs":[
   				{
   					"nodes":[
   						{
   							"op":"null",
   							"name":"inner_a",
   							"inputs":[]
   						},
   						{
   							"op":"null",
   							"name":"inner_b",
   							"inputs":[]
   						},
   						{
   							"op":"identity",
   							"name":"id_a",
   							"inputs":[[0,0,0]]
   						},
   						{
   							"op":"identity",
   							"name":"id_b",
   							"inputs":[[1,0,0]]
   						}						
   					],
   					"arg_nodes":[0,1],
   					"heads":[[3,0,0],[2,0,0]]
   				}
   			]
   		}
   	],
   	"arg_nodes":[0,1],
   	"heads":[[2,0,0], [2,1,0]],
   	"attrs":{
   		"mxnet_version":[
   			"int",
   			10300
   		]
   	}
   }"""
   
   sym = mx.sym.load_json(json)
   print(sym.infer_shape(a=(3,2), b=(3,5)))
   ```
   
   This prints:
   
   ```
   ([(3, 2), (3, 5)], [(3, 2), (3, 5)], [])
   ```
   
   But it should print:
   
   ```
   ([(3, 2), (3, 5)], [(3, 5), (3, 2)], [])
   ```
   
   Changing the value of `"heads":[[3,0,0],[2,0,0]]` to `"heads":[[2,0,0],[3,0,0]]` does nothing! It should determine the order of outputs of the inner foreach op.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services