MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _set_attr

Method _set_attr

python/paddle/base/framework.py:3836–3847  ·  view source on GitHub ↗

Set the value of attribute by attribute's name. Args: name(str): the attribute name. val(bool|int|str|float|list): the value of the attribute. Raises: ValueError: If the type of value doesn't match with desc.attr_type(name).

(self, name, val)

Source from the content-addressed store, hash-verified

3834 return self.desc.attr_type(name, True)
3835
3836 def _set_attr(self, name, val):
3837 """
3838 Set the value of attribute by attribute's name.
3839
3840 Args:
3841 name(str): the attribute name.
3842 val(bool|int|str|float|list): the value of the attribute.
3843
3844 Raises:
3845 ValueError: If the type of value doesn't match with desc.attr_type(name).
3846 """
3847 self._update_desc_attr(name, val)
3848
3849 def _remove_attr(self, name):
3850 self.desc.remove_attr(name)

Callers

nothing calls this directly

Calls 1

_update_desc_attrMethod · 0.95

Tested by

no test coverage detected