Skip to content

Commit 265cb43

Browse files
committed
fix cann compile error
1 parent c8d8931 commit 265cb43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml-cann/ggml-cann.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,8 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev,
22102210
case GGML_OP_COUNT_EQUAL:
22112211
return true;
22122212
case GGML_OP_SCALE:
2213-
float bias = ((const float *)(op->op_params))[1];
2213+
float bias;
2214+
memcpy(&bias, (float*)op->op_params + 1, sizeof(float));
22142215
return bias == 0.0f; // TODO: support bias != 0.0f
22152216
case GGML_OP_SOFT_MAX:
22162217
// TODO: support broadcast

0 commit comments

Comments
 (0)