MCPcopy
hub / github.com/vladmandic/sdnext / view

Method view

modules/sharpfin/sparse_backend.py:293–310  ·  view source on GitHub ↗
(self, *shape)

Source from the content-addressed store, hash-verified

291 return self
292
293 def view(self, *shape):
294 assert self.is_contiguous()
295 if shape[-1] != self.size()[-1]:
296 raise ValueError(
297 "Can't change view on compressed dimension. "
298 f"{self.size()[-1]} v. {shape[-1]}.")
299 if np.prod(shape) != np.prod(self.size()):
300 raise ValueError(
301 "Mismatch in numel of Matrix and new shape. "
302 f"{np.prod(self.size())} v. {np.prod(shape)}")
303 return Matrix(shape,
304 self.data,
305 self.row_indices,
306 self.column_indices,
307 self.offsets,
308 self.column_indices_t,
309 self.offsets_t,
310 self.block_offsets_t)
311
312 @property
313 def grad(self):

Callers 15

full_vae_decodeFunction · 0.80
diffusers_callbackFunction · 0.80
sdpa_flex_attenFunction · 0.80
__call__Method · 0.80
_unpack_latentsFunction · 0.80
_apply_split_toningFunction · 0.80
_apply_color_tempFunction · 0.80
tensor_to_bytesFunction · 0.80
quantize_weightFunction · 0.80
quantize_fp_mm_srFunction · 0.80
dequantize_asymmetricFunction · 0.80
dequantize_symmetricFunction · 0.80

Calls 3

is_contiguousMethod · 0.95
sizeMethod · 0.95
MatrixClass · 0.85

Tested by

no test coverage detected