MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_diag_mask_zero_impl

Function ggml_diag_mask_zero_impl

ggml.c:4920–4941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4918// ggml_diag_mask_zero
4919
4920static struct ggml_tensor * ggml_diag_mask_zero_impl(
4921 struct ggml_context * ctx,
4922 struct ggml_tensor * a,
4923 int n_past,
4924 bool inplace) {
4925 bool is_node = false;
4926
4927 if (a->grad) {
4928 is_node = true;
4929 }
4930
4931 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
4932
4933 int32_t params[] = { n_past };
4934 ggml_set_op_params(result, params, sizeof(params));
4935
4936 result->op = GGML_OP_DIAG_MASK_ZERO;
4937 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
4938 result->src[0] = a;
4939
4940 return result;
4941}
4942
4943struct ggml_tensor * ggml_diag_mask_zero(
4944 struct ggml_context * ctx,

Callers 3

ggml_diag_mask_zeroFunction · 0.70
ggml_compute_backwardFunction · 0.70

Calls 3

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70
ggml_set_op_paramsFunction · 0.70

Tested by

no test coverage detected