Convenience function for adding entries. Args: name (str): The name of the input. dtype (numpy.dtype): The data type of the input. shape (Sequence[Union[int, str]]]): The shape of the input. Dynamic dimensions may
(self, name, dtype, shape, min_shape=None, max_shape=None)
| 94 | return meta |
| 95 | |
| 96 | def add(self, name, dtype, shape, min_shape=None, max_shape=None): |
| 97 | """ |
| 98 | Convenience function for adding entries. |
| 99 | |
| 100 | Args: |
| 101 | name (str): The name of the input. |
| 102 | dtype (numpy.dtype): The data type of the input. |
| 103 | shape (Sequence[Union[int, str]]]): |
| 104 | The shape of the input. Dynamic dimensions may |
| 105 | be indicated by negative values, ``None``, or a string. |
| 106 | |
| 107 | min_shape (Sequence[int]): |
| 108 | The minimum valid shape for the input. |
| 109 | If provided, this shape should not include any dynamic dimensions. |
| 110 | max_shape (Sequence[int]): |
| 111 | The maximum valid shape for the input. |
| 112 | If provided, this shape should not include any dynamic dimensions. |
| 113 | |
| 114 | Returns: |
| 115 | The newly added entry. |
| 116 | """ |
| 117 | self[name] = MetadataTuple( |
| 118 | dtype, BoundedShape(shape, min=min_shape, max=max_shape) if shape is not None else None |
| 119 | ) |
| 120 | return self |
| 121 | |
| 122 | def __repr__(self): |
| 123 | ret = "TensorMetadata()" |
no test coverage detected