Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions compute/xla/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ func (f *Function) Parent() compute.Function {
return f.parent
}

// Builder returns the builder for this function.
func (f *Function) Builder() compute.Builder {
return f.builder
}

// Shape returns the shape of a value in the function.
func (f *Function) Shape(v compute.Value) (shapes.Shape, error) {
var s shapes.Shape
n, ok := v.(*Node)
if !ok {
return s, errors.Errorf("value is not a Node for a XLA backend, instead got a %T", v)
}
if err := f.CheckValid(); err != nil {
return s, err
}
return n.shape, nil
}

// Closure creates a new closure function, within this function.
func (f *Function) Closure() (compute.Function, error) {
if err := f.CheckValid(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.26

require (
github.com/gofrs/flock v0.13.0
github.com/gomlx/compute v0.0.0-20260502161841-2635c422f98b
github.com/gomlx/compute v0.0.0-20260503170902-d8816fd945e6
github.com/janpfeifer/go-benchmarks v0.1.1
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
github.com/gomlx/compute v0.0.0-20260502161841-2635c422f98b h1:eI6OSkBrZlBIJFWhnMQQvDiYYxmhKEOoPE48F2xj89k=
github.com/gomlx/compute v0.0.0-20260502161841-2635c422f98b/go.mod h1:MDTT683Wvq7IMSKXDGLvV3Co7HDpx/Xsgp2RbF5lhNM=
github.com/gomlx/compute v0.0.0-20260503170902-d8816fd945e6 h1:hNOnr1edFWagejh5FRIweSGijOGNVRXbMRwu8kaiIgw=
github.com/gomlx/compute v0.0.0-20260503170902-d8816fd945e6/go.mod h1:MDTT683Wvq7IMSKXDGLvV3Co7HDpx/Xsgp2RbF5lhNM=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/janpfeifer/go-benchmarks v0.1.1 h1:gLLy07/JrOKSnMWeUxSnjTdhkglgmrNR2IBDnR4kRqw=
Expand Down