MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / set

Method set

PATH/core/data/datasets/images/seg_dataset_dev.py:74–85  ·  view source on GitHub ↗

Set the field named `name` to `value`. The length of `value` must be the number of instances, and must agree with other existing fields in this object.

(self, name: str, value: Any)

Source from the content-addressed store, hash-verified

72 return self._fields[name]
73
74 def set(self, name: str, value: Any) -> None:
75 """
76 Set the field named `name` to `value`.
77 The length of `value` must be the number of instances,
78 and must agree with other existing fields in this object.
79 """
80 data_len = len(value)
81 if len(self._fields):
82 assert (
83 len(self) == data_len
84 ), "Adding a field of length {} to a Instances of length {}".format(data_len, len(self))
85 self._fields[name] = value
86
87 def has(self, name: str) -> bool:
88 """

Callers 5

__init__Method · 0.95
__setattr__Method · 0.95
cudaMethod · 0.95
__getitem__Method · 0.95
catMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected