docstr: :param main_flow: tensor, input to the VNet block
  :param bypass_flow: tensor, input from skip connection
  :return: res_flow is tensor before final block operation (for residual connections),
      main_flow is final output tensor
docstr_tok: [":","param","main_flow",":","tensor",",","input","to","the","VNet","block",":","param","bypass_flow",":","tensor",",","input","from","skip","connection",":","return",":","res_flow","is","tensor","before","final","block","operation","(","for","residual","connections",")",",","main_flow","is","final","output","tensor"]
code: def layer_op(self, main_flow, bypass_flow):
      """
  
      :param main_flow: tensor, input to the VNet block
      :param bypass_flow: tensor, input from skip connection
      :return: res_flow is tensor before final block operation (for residual connections),
          main_flow is final output tensor
      """
      for i in range(self.n_conv):
          main_flow = ConvLayer(
              name="conv_{}".format(i),
              n_output_chns=self.n_feature_chns,
              w_initializer=self.initializers["w"],
              w_regularizer=self.regularizers["w"],
              kernel_size=5,
          )(main_flow)
          if (
              i < self.n_conv - 1
          ):  # no activation for the last conv layer
              main_flow = ActiLayer(
                  func=self.acti_func,
                  regularizer=self.regularizers["w"],
              )(main_flow)
      res_flow = ElementwiseLayer("SUM")(main_flow, bypass_flow)
  
      if self.func == "DOWNSAMPLE":
          main_flow = ConvLayer(
              name="downsample",
              n_output_chns=self.n_output_chns,
              w_initializer=self.initializers["w"],
              w_regularizer=self.regularizers["w"],
              kernel_size=2,
              stride=2,
              with_bias=True,
          )(res_flow)
      elif self.func == "UPSAMPLE":
          main_flow = DeconvLayer(
              name="upsample",
              n_output_chns=self.n_output_chns,
              w_initializer=self.initializers["w"],
              w_regularizer=self.regularizers["w"],
              kernel_size=2,
              stride=2,
              with_bias=True,
          )(res_flow)
      elif self.func == "SAME":
          main_flow = ConvLayer(
              name="conv_1x1x1",
              n_output_chns=self.n_output_chns,
              w_initializer=self.initializers["w"],
              w_regularizer=self.regularizers["w"],
              b_initializer=self.initializers["b"],
              b_regularizer=self.regularizers["b"],
              kernel_size=1,
              with_bias=True,
          )(res_flow)
      main_flow = ActiLayer(self.acti_func)(main_flow)
      print(self)
      return res_flow, main_flow
  
file_path: NiftyNet/niftynet/network/vnet.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from niftynet.layer import layer_util
  from niftynet.layer.activation import ActiLayer
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.convolution import ConvLayer
  from niftynet.layer.deconvolution import DeconvLayer
  from niftynet.layer.elementwise import ElementwiseLayer
  from niftynet.network.base_net import BaseNet
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 2 for calling the VNetBlock obj's underlying member method code with example usage: obj.layer_op(main_flow, bypass_flow) and returns: res_flow,  main_flow