def get_max_data_extent(net, layer, rc, is_conv):
 if is_conv:
  conv_size = net.blobs[layer].data.shape[2:4]
  layer_slice_middle = ((conv_size[0] / 2), ((conv_size[0] / 2) + 1), (conv_size[1] / 2), ((conv_size[1] / 2) + 1))
  data_slice = rc.convert_region(layer, 'data', layer_slice_middle)
  return ((data_slice[1] - data_slice[0]), (data_slice[3] - data_slice[2]))
 else:
  return net.blobs['data'].data.shape[2:4]

def get_max_data_extent ( net , layer , rc , is_conv ) : if is_conv : conv_size = net . blobs [ layer ] . data . shape [ 2 : 4 ] layer_slice_middle = ( ( conv_size [ 0 ] / 2 ) , ( ( conv_size [ 0 ] / 2 ) + 1 ) , ( conv_size [ 1 ] / 2 ) , ( ( conv_size [ 1 ] / 2 ) + 1 ) ) data_slice = rc . convert_region ( layer , 'data' , layer_slice_middle ) return ( ( data_slice [ 1 ] - data_slice [ 0 ] ) , ( data_slice [ 3 ] - data_slice [ 2 ] ) ) else : return net . blobs [ 'data' ] . data . shape [ 2 : 4 ]
gets the maximum size of the data layer that can influence a unit on layer .