How to avoid passing a fixed-value array of large size to a function?

  function, python-3.x

I have a function

               y=func(x,A) 

where A is value fixed and of size about 1000x1000x10. I need to call func many times. But every time I call the function, I need to pass A to it, which takes too much time. So, Is there a method that I need only pass A to the function only one time? Thank you very much.

I try to implement the funtcion as a class:

class fun_class():
      def __init__(self,A):
          self.A=A

      def func_1(self,x):
          return func(x,self.A)

But the runtime did not decrease.

Source: Python-3x Questions

LEAVE A COMMENT