MCPcopy
hub / github.com/dask/dask / tri

Function tri

dask/array/creation.py:826–840  ·  view source on GitHub ↗
(N, M=None, k=0, dtype=float, chunks="auto", *, like=None)

Source from the content-addressed store, hash-verified

824
825@derived_from(np)
826def tri(N, M=None, k=0, dtype=float, chunks="auto", *, like=None):
827 if M is None:
828 M = N
829
830 chunks = normalize_chunks(chunks, shape=(N, M), dtype=dtype)
831
832 m = greater_equal(
833 arange(N, chunks=chunks[0][0], like=like).reshape(1, N).T,
834 arange(-k, M - k, chunks=chunks[1][0], like=like),
835 )
836
837 # Avoid making a copy if the requested type is already bool
838 m = m.astype(dtype, copy=False)
839
840 return m
841
842
843@derived_from(np)

Callers 4

trilFunction · 0.90
triuFunction · 0.90
tril_indicesFunction · 0.90
triu_indicesFunction · 0.90

Calls 4

normalize_chunksFunction · 0.90
reshapeMethod · 0.80
arangeFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected