MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / test_padding_value_attr

Function test_padding_value_attr

test/python/cuda_tile_public_bindings.py:135–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133
134
135def test_padding_value_attr():
136 from cuda_tile._mlir._mlir_libs._cuda_tile import PaddingValueAttr
137 from cuda_tile._mlir.ir import Context, Attribute
138
139 with Context() as ctx:
140 register_dialect(ctx, load=True)
141 created = PaddingValueAttr.get("zero")
142 assert created.value == "zero"
143
144 created = PaddingValueAttr.get("neg_zero")
145 assert created.value == "neg_zero"
146
147 created = PaddingValueAttr.get("nan")
148 assert created.value == "nan"
149
150 created = PaddingValueAttr.get("pos_inf")
151 assert created.value == "pos_inf"
152
153 created = PaddingValueAttr.get("neg_inf")
154 assert created.value == "neg_inf"
155
156 with pytest.raises(ValueError, match="Invalid padding value: invalid_value"):
157 PaddingValueAttr.get("invalid_value")
158
159
160###############################################################################

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected