class_docstr: Implement some special requirement ops
class_docstr_tok: ["Implement","some","special","requirement","ops"]
docstr:  Implement linear ops, also known as full connection in Caffe
  
  Args:
      output_shape (tuple): the output channel size
      input_shape (tuple): the input channel size
      scale_init (`np.array`): the tensor saving initialize values of scale
      bias_init (`np.array`): the tensor saving initialize values of bias
      name (str): the name of ops
  
  Return:
      :func:`~cntk.ops.as_block`: the function contains linear ops
docstr_tok: ["Implement","linear","ops",",","also","known","as","full","connection","in","Caffe","Args",":","output_shape","(","tuple",")",":","the","output","channel","size","input_shape","(","tuple",")",":","the","input","channel","size","scale_init","(","`","np.array","`",")",":","the","tensor","saving","initialize","values","of","scale","bias_init","(","`","np.array","`",")",":","the","tensor","saving","initialize","values","of","bias","name","(","str",")",":","the","name","of","ops","Return",":",":","func",":","`","~cntk.ops.as_block","`",":","the","function","contains","linear","ops"]
code: def linear(output_shape, input_shape, scale_init, bias_init, name):
      """
       Implement linear ops, also known as full connection in Caffe
  
      Args:
          output_shape (tuple): the output channel size
          input_shape (tuple): the input channel size
          scale_init (`np.array`): the tensor saving initialize values of scale
          bias_init (`np.array`): the tensor saving initialize values of bias
          name (str): the name of ops
  
      Return:
          :func:`~cntk.ops.as_block`: the function contains linear ops
      """
      sc = ops.parameter(
          shape=input_shape + output_shape,
          init=scale_init,
          name=".".join((name, "sc")),
      )
      b = ops.parameter(
          shape=output_shape, init=bias_init, name=".".join((name, "b"))
      )
  
      @BlockFunction("linear", name)
      def _linear(x):
          apply_x = ops.times(x, sc)
          apply_x += b
          return apply_x
  
      return _linear
  
imports: from operator import mul
  from functools import reduce
  import numpy
  import cntk
  import cntk.io.transforms
  from cntk import ops, io, learners, internal
  from cntk import Trainer
  from cntk.layers.blocks import BlockFunction
label_desc: Use image node_id 2 for calling the BlockApiSetup obj's underlying member method code with example usage: obj.linear(output_shape, input_shape, scale_init, bias_init, name) and returns: _linear, apply_x