ninetoothed 0.10.0__py3-none-any.whl → 0.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ninetoothed/tensor.py CHANGED
@@ -132,6 +132,7 @@ class Tensor:
132
132
  ],
133
133
  source=self.source,
134
134
  source_dims=self.source_dims,
135
+ target_dims=self.target_dims,
135
136
  )
136
137
 
137
138
  def squeeze(self, dim):
@@ -149,6 +150,11 @@ class Tensor:
149
150
  for i, source_dim in enumerate(self.source_dims)
150
151
  if i not in dim
151
152
  ],
153
+ target_dims=[
154
+ target_dim
155
+ for i, target_dim in enumerate(self.target_dims)
156
+ if i not in dim
157
+ ],
152
158
  )
153
159
 
154
160
  def permute(self, dims):
@@ -168,6 +174,7 @@ class Tensor:
168
174
  strides=new_strides,
169
175
  source=self.source,
170
176
  source_dims=new_source_dims,
177
+ target_dims=self.target_dims,
171
178
  )
172
179
 
173
180
  def flatten(self, start_dim=None, end_dim=None):
@@ -197,12 +204,21 @@ class Tensor:
197
204
  leading_source_dims + (flattening_source_dims,) + trailing_source_dims
198
205
  )
199
206
 
207
+ leading_target_dims = self.target_dims[:start_dim]
208
+ flattening_target_dims = self.target_dims[start_dim:end_dim]
209
+ trailing_target_dims = self.target_dims[end_dim:]
210
+
211
+ new_target_dims = (
212
+ leading_target_dims + (flattening_target_dims[-1],) + trailing_target_dims
213
+ )
214
+
200
215
  return type(self)(
201
216
  shape=new_shape,
202
217
  dtype=self.dtype,
203
218
  strides=new_strides,
204
219
  source=self.source,
205
220
  source_dims=new_source_dims,
221
+ target_dims=new_target_dims,
206
222
  )
207
223
 
208
224
  def ravel(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ninetoothed
3
- Version: 0.10.0
3
+ Version: 0.11.0
4
4
  Summary: A domain-specific language based on Triton but providing higher-level abstraction.
5
5
  Project-URL: Homepage, https://github.com/InfiniTensor/ninetoothed
6
6
  Project-URL: Issues, https://github.com/InfiniTensor/ninetoothed/issues
@@ -3,9 +3,9 @@ ninetoothed/jit.py,sha256=0LeDBpSYFgPx4hatP_ZsvElsj0d9d552OKRc__L1Jvc,23460
3
3
  ninetoothed/language.py,sha256=YwjlBENmmKPTnhaQ2uYbj5MwzrCAT7MLJ6VkQ6NeXJE,504
4
4
  ninetoothed/naming.py,sha256=Fl0x4eDRStTpkXjJg6179ErEnY7bR5Qi0AT6RX9C3fU,951
5
5
  ninetoothed/symbol.py,sha256=rZ5nXtn-U1Nw0BBRJ-kfrwmX_zCbAi76un-Z2QFaoZc,4773
6
- ninetoothed/tensor.py,sha256=LGS9wYmPKckZjIEXsMHdclTmVhzkfrc3avOPiCQY1tU,9153
6
+ ninetoothed/tensor.py,sha256=ehgbHrxL1gc9iOI9rGUp5k-nI_daLmCfOdLI9hE-GLw,9756
7
7
  ninetoothed/torchifier.py,sha256=aDijK5UOwK2oLXDHgDo8M959rJclEI0lcfaPr7GQTXY,1012
8
- ninetoothed-0.10.0.dist-info/METADATA,sha256=nQWkQ--AceNN3DoD-kP9_aykZYVw8LOfqf2iO63v1Ek,7055
9
- ninetoothed-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- ninetoothed-0.10.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- ninetoothed-0.10.0.dist-info/RECORD,,
8
+ ninetoothed-0.11.0.dist-info/METADATA,sha256=NlC4oj1R7gNoCdA1AxYc_7UWY3uZPv3LeOq9Jo-9Q8w,7055
9
+ ninetoothed-0.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ ninetoothed-0.11.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ ninetoothed-0.11.0.dist-info/RECORD,,