class_docstr: Implements the Numpy backend ops for a PC auto-batching VM.
class_docstr_tok: ["Implements","the","Numpy","backend","ops","for","a","PC","auto-batching","VM","."]
docstr: Returns an intialized Variable.
  
  Args:
    name: Name for the variable.
    alloc: `VariableAllocation` for the variable.
    type_: `instructions.TensorType` describing the sub-batch shape and dtype
      of the variable being created.
    max_stack_depth: Python `int`, the maximum stack depth to enforce.
    batch_size: Python `int`, the number of parallel threads being executed.
  
  Returns:
    var: A new, initialized Variable object.
docstr_tok: ["Returns","an","intialized","Variable",".","Args",":","name",":","Name","for","the","variable",".","alloc",":","`","VariableAllocation","`","for","the","variable",".","type_",":","`","instructions.TensorType","`","describing","the","sub-batch","shape","and","dtype","of","the","variable","being","created",".","max_stack_depth",":","Python","`","int","`",",","the","maximum","stack","depth","to","enforce",".","batch_size",":","Python","`","int","`",",","the","number","of","parallel","threads","being","executed",".","Returns",":","var",":","A","new",",","initialized","Variable","object","."]
code: def create_variable(
      self, name, alloc, type_, max_stack_depth, batch_size
  ):
      """Returns an intialized Variable.
  
      Args:
        name: Name for the variable.
        alloc: `VariableAllocation` for the variable.
        type_: `instructions.TensorType` describing the sub-batch shape and dtype
          of the variable being created.
        max_stack_depth: Python `int`, the maximum stack depth to enforce.
        batch_size: Python `int`, the number of parallel threads being executed.
  
      Returns:
        var: A new, initialized Variable object.
      """
      del name
      if alloc is instructions.VariableAllocation.NULL:
          return instructions.NullVariable()
      elif alloc is instructions.VariableAllocation.TEMPORARY:
          return instructions.TemporaryVariable.empty()
      else:
          dtype, event_shape = type_
          value = np.zeros(
              [batch_size] + list(event_shape), dtype=dtype
          )
          if alloc is instructions.VariableAllocation.REGISTER:
              return RegisterNumpyVariable(value)
          else:
              return FullNumpyVariable(
                  value, _create_stack(max_stack_depth, value)
              )
  
imports: import collections
  import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 10 for calling the NumpyBackend obj's underlying member method code with example usage: obj.create_variable(name, alloc, type_, max_stack_depth, batch_size) and returns: instructions, instructions, RegisterNumpyVariable, FullNumpyVariable