@@ -349,63 +349,63 @@ def value(self, v):
349349 self ._been_writen = True # set the flag
350350 self ._write_value (v ) # write the value
351351
352- def tree_flatten (self ):
353- """Flattens this variable.
354-
355- Returns:
356- A pair where the first element is a list of leaf values
357- and the second element is a treedef representing the
358- structure of the flattened tree.
359- """
360- return (self ._value ,), None
361-
362- @classmethod
363- def tree_unflatten (cls , aux_data , flat_contents ):
364- """Reconstructs a variable from the aux_data and the leaves.
365-
366- Args:
367- aux_data:
368- flat_contents:
369-
370- Returns:
371- The variable.
372- """
373- return cls (* flat_contents )
374-
375- def clone (self ) -> 'Variable' :
376- """Clone the variable. """
377- r = type (self )(jnp .array (self .value , copy = True ), batch_axis = self .batch_axis )
378- return r
379-
380- def __eq__ (self , other ):
381- """Override State's __eq__ to use BaseArray behavior for element-wise comparison."""
382- from brainpy ._src .math .ndarray import _check_input_array , _return
383- return _return (self .value == _check_input_array (other ))
384-
385- def __ne__ (self , other ):
386- """Override State's __ne__ to use BaseArray behavior for element-wise comparison."""
387- from brainpy ._src .math .ndarray import _check_input_array , _return
388- return _return (self .value != _check_input_array (other ))
389-
390- def __lt__ (self , other ):
391- """Override State's __lt__ to use BaseArray behavior for element-wise comparison."""
392- from brainpy ._src .math .ndarray import _check_input_array , _return
393- return _return (self .value < _check_input_array (other ))
394-
395- def __le__ (self , other ):
396- """Override State's __le__ to use BaseArray behavior for element-wise comparison."""
397- from brainpy ._src .math .ndarray import _check_input_array , _return
398- return _return (self .value <= _check_input_array (other ))
399-
400- def __gt__ (self , other ):
401- """Override State's __gt__ to use BaseArray behavior for element-wise comparison."""
402- from brainpy ._src .math .ndarray import _check_input_array , _return
403- return _return (self .value > _check_input_array (other ))
404-
405- def __ge__ (self , other ):
406- """Override State's __ge__ to use BaseArray behavior for element-wise comparison."""
407- from brainpy ._src .math .ndarray import _check_input_array , _return
408- return _return (self .value >= _check_input_array (other ))
352+ # def tree_flatten(self):
353+ # """Flattens this variable.
354+ #
355+ # Returns:
356+ # A pair where the first element is a list of leaf values
357+ # and the second element is a treedef representing the
358+ # structure of the flattened tree.
359+ # """
360+ # return (self._value,), None
361+ #
362+ # @classmethod
363+ # def tree_unflatten(cls, aux_data, flat_contents):
364+ # """Reconstructs a variable from the aux_data and the leaves.
365+ #
366+ # Args:
367+ # aux_data:
368+ # flat_contents:
369+ #
370+ # Returns:
371+ # The variable.
372+ # """
373+ # return cls(*flat_contents)
374+
375+ # def clone(self) -> 'Variable':
376+ # """Clone the variable. """
377+ # r = type(self)(jnp.array(self.value, copy=True), batch_axis=self.batch_axis)
378+ # return r
379+
380+ # def __eq__(self, other):
381+ # """Override State's __eq__ to use BaseArray behavior for element-wise comparison."""
382+ # from brainpy._src.math.ndarray import _check_input_array, _return
383+ # return _return(self.value == _check_input_array(other))
384+ #
385+ # def __ne__(self, other):
386+ # """Override State's __ne__ to use BaseArray behavior for element-wise comparison."""
387+ # from brainpy._src.math.ndarray import _check_input_array, _return
388+ # return _return(self.value != _check_input_array(other))
389+ #
390+ # def __lt__(self, other):
391+ # """Override State's __lt__ to use BaseArray behavior for element-wise comparison."""
392+ # from brainpy._src.math.ndarray import _check_input_array, _return
393+ # return _return(self.value < _check_input_array(other))
394+ #
395+ # def __le__(self, other):
396+ # """Override State's __le__ to use BaseArray behavior for element-wise comparison."""
397+ # from brainpy._src.math.ndarray import _check_input_array, _return
398+ # return _return(self.value <= _check_input_array(other))
399+ #
400+ # def __gt__(self, other):
401+ # """Override State's __gt__ to use BaseArray behavior for element-wise comparison."""
402+ # from brainpy._src.math.ndarray import _check_input_array, _return
403+ # return _return(self.value > _check_input_array(other))
404+ #
405+ # def __ge__(self, other):
406+ # """Override State's __ge__ to use BaseArray behavior for element-wise comparison."""
407+ # from brainpy._src.math.ndarray import _check_input_array, _return
408+ # return _return(self.value >= _check_input_array(other))
409409
410410
411411def _get_dtype (v ):
0 commit comments