Skip to content

Commit

Permalink
[chore] remove unused attr in constant node (secretflow#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
FollyCoolly authored Feb 17, 2025
1 parent 16e89f2 commit b7009be
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 48 deletions.
2 changes: 1 addition & 1 deletion engine/bazel/engine_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _secretflow_deps():
"https://github.com/secretflow/kuscia/archive/refs/tags/v0.13.0b0.tar.gz",
],
strip_prefix = "kuscia-0.13.0b0",
sha256 = "8c7b638ef510a665af12f7b92ed0c43de7712154234e52ef4d8609b8afebfdac",
sha256 = "855e458164ce34a406556db8b40966ee2ebef3b88c5244afdff2b20e94a46d1a",
)

def _org_apache_arrow():
Expand Down
5 changes: 1 addition & 4 deletions pkg/interpreter/graph/graph_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,8 @@ func (plan *GraphBuilder) AddConstantNode(name string, value *types.Datum, party
output.CC = cc
output.IsConstScalar = true

attr1 := &Attribute{}
var statusPublic int64 = 1
attr1.SetInt64(statusPublic)
if _, err := plan.AddExecutionNode(name, operator.OpNameConstant, map[string][]*Tensor{},
map[string][]*Tensor{"Out": {output}}, map[string]*Attribute{operator.ScalarAttr: attr, operator.ToStatusAttr: attr1}, partyCodes); err != nil {
map[string][]*Tensor{"Out": {output}}, map[string]*Attribute{operator.ScalarAttr: attr}, partyCodes); err != nil {
return nil, err
}
return output, nil
Expand Down
3 changes: 0 additions & 3 deletions pkg/interpreter/operator/operator_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,10 @@ Out = {a, d}
opDef.AddOutput("Out", "output tensor(shape [M]) from constant.",
proto.FormalParameterOptions_FORMALPARAMETEROPTIONS_SINGLE, T)
opDef.AddAttribute(ScalarAttr, "scalar attribute(with shape [M])")
opDef.AddAttribute(ToStatusAttr, "int64. to status, 0: to private, 1: to public.")
opDef.AddDefaultAttributeValue(ToStatusAttr, CreateIntAttribute(0))
opDef.SetDefinition(`Definition: Make constant from attribute.
Example:
` + "\n```python" + `
scalar = [{"a", "b", "c"}]
to_status = 0
Out = [{"a", "b", "c"}]
` + "```\n")
opDef.SetParamTypeConstraint(T, statusPrivateOrPublic)
Expand Down
Loading

0 comments on commit b7009be

Please sign in to comment.