class_docstr: Variable that is shared between compiled functions.
class_docstr_tok: ["Variable","that","is","shared","between","compiled","functions","."]
docstr: Get the non-symbolic value associated with this SharedVariable.
  
  Parameters
  ----------
  borrow : bool
      True to permit returning of an object aliased to internal memory.
  return_internal_type : bool
      True to permit the returning of an arbitrary type object used
      internally to store the shared variable.
  
  Only with borrow=False and return_internal_type=True does this function
  guarantee that you actually get the internal object.
  But in that case, you may get different return types when using
  different compute devices.
docstr_tok: ["Get","the","non-symbolic","value","associated","with","this","SharedVariable",".","Parameters","--","--","--","--","--","borrow",":","bool","True","to","permit","returning","of","an","object","aliased","to","internal","memory",".","return_internal_type",":","bool","True","to","permit","the","returning","of","an","arbitrary","type","object","used","internally","to","store","the","shared","variable",".","Only","with","borrow=False","and","return_internal_type=True","does","this","function","guarantee","that","you","actually","get","the","internal","object",".","But","in","that","case",",","you","may","get","different","return","types","when","using","different","compute","devices","."]
code: def get_value(self, borrow=False, return_internal_type=False):
      """
      Get the non-symbolic value associated with this SharedVariable.
  
      Parameters
      ----------
      borrow : bool
          True to permit returning of an object aliased to internal memory.
      return_internal_type : bool
          True to permit the returning of an arbitrary type object used
          internally to store the shared variable.
  
      Only with borrow=False and return_internal_type=True does this function
      guarantee that you actually get the internal object.
      But in that case, you may get different return types when using
      different compute devices.
  
      """
      if borrow:
          return self.container.value
      else:
          return copy.deepcopy(self.container.value)
  
file_path: pytensor/pytensor/compile/sharedvalue.py
imports: import copy
  from contextlib import contextmanager
  from functools import singledispatch
  from typing import TYPE_CHECKING, Optional
  from pytensor.graph.basic import Variable
  from pytensor.graph.utils import add_tag_trace
  from pytensor.link.basic import Container
  from pytensor.link.c.type import generic
label_desc: Use image node_id 2 for calling the SharedVariable obj's underlying member method code with example usage: obj.get_value(borrow, return_internal_type) and returns: self, copy