Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LaurentMazare/xla-rs
/ functions
Functions
409 in github.com/LaurentMazare/xla-rs
⨍
Functions
409
◇
Types & classes
59
↓ 77 callers
Method
len
(&self)
examples/llama/var_store.rs:38
↓ 52 callers
Method
as_ptr
(&self)
src/wrappers/shape.rs:208
↓ 31 callers
Method
clone
(&self)
src/wrappers/xla_op.rs:51
↓ 26 callers
Method
reshape
Reshape this node to a different set of dimension sizes, the number of element between the two different shapes has to match.
src/wrappers/xla_op.rs:145
↓ 24 callers
Function
handle_status
(status: c_lib::status)
src/wrappers/mod.rs:294
↓ 24 callers
Method
ptr
(&self)
src/wrappers/xla_builder.rs:22
↓ 23 callers
Method
build
Generate a computation which root value is this node.
src/wrappers/xla_op.rs:648
↓ 21 callers
Method
wrap
(&self, op: c_lib::xla_op)
src/wrappers/xla_op.rs:58
↓ 20 callers
Method
compile
Compile this computation for the specified client.
src/wrappers/mod.rs:324
↓ 20 callers
Method
to_vec
Copy the values stored in the literal in a newly created vector. The data is flattened out for literals with more than one dimension.
src/wrappers/literal.rs:155
↓ 19 callers
Method
parameter
Create an input node with the specified type and dimensions. A literal has to be passed for each of the parameter in the graph when calling the `execu
src/wrappers/xla_builder.rs:77
↓ 18 callers
Method
to_literal_sync
Copy the buffer back to the host as a literal.
src/wrappers/pjrt_buffer.rs:27
↓ 16 callers
Method
builder
(&self)
src/wrappers/xla_op.rs:63
↓ 14 callers
Method
wrap
(&self, op: c_lib::xla_op)
src/wrappers/xla_builder.rs:68
↓ 13 callers
Method
c0
A shorter notation for `constant_r0`.
src/wrappers/xla_builder.rs:64
↓ 13 callers
Method
get
()
build.rs:15
↓ 12 callers
Function
get_and_remove
(key, transpose=False)
examples/llama/convert_checkpoint.py:14
↓ 12 callers
Method
slice_in_dim1
A specialized version of `slice_in_dim` using a stride of one, so with all values with an index between `start_index` (inclusive) and `stop_index` (ex
src/wrappers/xla_op.rs:213
↓ 11 callers
Method
array_shape
(&self)
src/wrappers/xla_op.rs:419
↓ 10 callers
Method
constant_r0
Create a node with a constant scalar value using the type of the element that is passed as argument.
src/wrappers/xla_builder.rs:58
↓ 10 callers
Method
element_type
(&self)
src/wrappers/shape.rs:21
↓ 10 callers
Method
primitive_type
(&self)
src/wrappers/mod.rs:121
↓ 10 callers
Method
ptr
(&self)
src/wrappers/pjrt_client.rs:45
↓ 10 callers
Method
swap_dims
Permute two dimensions, this is a specialized version of `transpose`.
src/wrappers/xla_op.rs:186
↓ 9 callers
Method
decompose_tuple
When the input is a tuple, return a vector of its elements. This replaces the original value by an empty tuple, no copy is performed.
src/wrappers/literal.rs:200
↓ 9 callers
Method
to_string
(&self)
src/npy.rs:67
↓ 8 callers
Method
convert
Create a new node by casting the elements of the original node to a new primitive type.
src/wrappers/xla_op.rs:302
↓ 8 callers
Method
dims
(&self)
src/wrappers/xla_op.rs:423
↓ 8 callers
Method
primitive_type
The kind of elements that are computed by this operand.
src/wrappers/xla_op.rs:401
↓ 8 callers
Method
reduce_sum
A node that computes the sum across the specified dimensions, e.g. if all the dimensions are passed as an argument the result is a scalar with the sum
src/wrappers/xla_op.rs:529
↓ 8 callers
Method
take
( &mut self, s: &str, expected_type: ElementType, expected_dims: &[usize],
examples/nanogpt/var_store.rs:24
↓ 7 callers
Function
c_ptr_to_string
(ptr: *const std::ffi::c_char)
src/wrappers/mod.rs:24
↓ 7 callers
Method
dims
(&self)
src/wrappers/shape.rs:40
↓ 7 callers
Method
len
(&self)
examples/nanogpt/var_store.rs:20
↓ 7 callers
Method
normalize_index
(&self, index: i64)
src/wrappers/xla_op.rs:325
↓ 6 callers
Method
broadcast
Add some broadcasting dimensions at the beginning of the current node shape.
src/wrappers/xla_op.rs:151
↓ 6 callers
Method
shape
(&self)
src/wrappers/shape.rs:181
↓ 5 callers
Method
constant_literal
Create a node with a constant value defined by the specified literal.
src/wrappers/xla_builder.rs:51
↓ 5 callers
Method
devices
A list of devices attached to this client.
src/wrappers/pjrt_client.rs:84
↓ 5 callers
Method
rank
The number of dimensions for this node.
src/wrappers/xla_op.rs:411
↓ 5 callers
Method
ty
(&self)
src/wrappers/shape.rs:25
↓ 5 callers
Method
var
(&mut self, s: &str, dims: &[usize])
examples/llama/var_store.rs:58
↓ 4 callers
Method
constant_r1
A one dimension constant node based on some slice stored on the host.
src/wrappers/xla_builder.rs:123
↓ 4 callers
Method
dimensions_size
A node that contains the size of the dimension with the target index as a `S32` scalar value.
src/wrappers/xla_op.rs:340
↓ 4 callers
Method
dot_general
General dot multiplication between two nodes, specifying the dimensions that get contracted as well as the batch dimensions.
src/wrappers/xla_op.rs:440
↓ 4 callers
Method
element_count
The number of elements stored in the literal.
src/wrappers/literal.rs:68
↓ 4 callers
Function
make_shape_internal
xla_rs/xla_rs.cc:213
↓ 4 callers
Method
matmul
Matrix multiplication, this is a specialized version of `dot_general` to be used for matrix-matrix or matrix-vector multiplications.
src/wrappers/xla_op.rs:594
↓ 4 callers
Function
parse
()
src/npy.rs:337
↓ 4 callers
Method
reduce_mean
A node that computes the average value across the specified dimensions.
src/wrappers/xla_op.rs:540
↓ 4 callers
Method
softmax
(&self, dim: i64)
src/wrappers/xla_op.rs:573
↓ 4 callers
Method
to_string
(&self)
src/wrappers/pjrt_device.rs:25
↓ 4 callers
Method
tuple
Create a new tuple shape.
src/wrappers/shape.rs:73
↓ 3 callers
Method
element_count
The number of elements stored in arrays that use this shape, this is the product of sizes across each dimension.
src/wrappers/shape.rs:36
↓ 3 callers
Method
element_size_in_bytes
The size for this element type in bytes.
src/wrappers/mod.rs:101
↓ 3 callers
Method
execute
( &self, args: &[L], )
src/wrappers/pjrt_loaded_executable.rs:42
↓ 3 callers
Method
get_tuple_element
Index into tuples.
src/wrappers/xla_op.rs:253
↓ 3 callers
Method
one
A scalar node with the one value for the associated type.
src/wrappers/xla_builder.rs:140
↓ 3 callers
Method
parameter_s
(&self, parameter_number: i64, shape: &Shape, name: &str)
src/wrappers/xla_builder.rs:107
↓ 3 callers
Function
read_header
(reader: &mut R)
src/npy.rs:38
↓ 3 callers
Method
reduce
Create a node by folding a computation acress some target dimensions. If `keep_dims` is `true`, the resulting node has a dimension of size one for the
src/wrappers/xla_op.rs:350
↓ 3 callers
Function
tr
(v)
examples/llama/convert_checkpoint.py:8
↓ 3 callers
Method
transpose
Permute the dimension with the specified indexes.
src/wrappers/xla_op.rs:180
↓ 3 callers
Method
ty
The element type used by element stored in this literal, shortcut for `element_type`.
src/wrappers/literal.rs:87
↓ 3 callers
Method
zero
A scalar node with the zero value for the associated type.
src/wrappers/xla_builder.rs:134
↓ 2 callers
Method
addressable_device_count
The number of devices that this client can use.
src/wrappers/pjrt_client.rs:63
↓ 2 callers
Method
apply_rotary_emb
(&self, x: &XlaOp, freqs_cis: &XlaOp)
examples/llama/main.rs:218
↓ 2 callers
Method
buffer_from_host_raw_bytes
Transfer some data from the host to a `PjRtBuffer` stored on the target device. If the device is not specified, the default device is used. The source
src/wrappers/pjrt_client.rs:137
↓ 2 callers
Method
client
The client that owns this buffer.
src/wrappers/pjrt_buffer.rs:13
↓ 2 callers
Method
concat_in_dim
Concat multiple nodes (together with the `self` node) along the target dimension.
src/wrappers/xla_op.rs:241
↓ 2 callers
Method
constant_r1c
(&self, f: T, len: usize)
src/wrappers/xla_builder.rs:117
↓ 2 callers
Method
copy_raw_to
Copy the literal data to a slice. This returns an error if the primitive type used by the literal is not `T` or if the number of elements in the slice
src/wrappers/literal.rs:112
↓ 2 callers
Method
device_count
The number of devices that this client has detected, e.g. the number of GPUs.
src/wrappers/pjrt_client.rs:58
↓ 2 callers
Method
get_current_status
This returns `Ok(())` if the graph creation has not generated any error so far. Otherwise the current status is returned.
src/wrappers/xla_builder.rs:44
↓ 2 callers
Method
get_dimensions_size
The number of dimensions (a.k.a the rank) associated with this op.
src/wrappers/xla_builder.rs:235
↓ 2 callers
Method
get_shape
The shape associated with this op.
src/wrappers/xla_builder.rs:209
↓ 2 callers
Method
last_dim
(&self)
src/wrappers/shape.rs:48
↓ 2 callers
Method
name
The computation name.
src/wrappers/mod.rs:316
↓ 2 callers
Method
on_device_shape
Retrieve the shape used by this buffer.
src/wrappers/pjrt_buffer.rs:35
↓ 2 callers
Function
pjrt_buffer_from_host_buffer
xla_rs/xla_rs.cc:94
↓ 2 callers
Method
primitive_type
The primitive type used by element stored in this literal.
src/wrappers/literal.rs:73
↓ 2 callers
Method
process_execute_outputs
( &self, outputs: *mut *mut c_lib::pjrt_buffer, )
src/wrappers/pjrt_loaded_executable.rs:15
↓ 2 callers
Method
select
Select values from the original tensor to be values from `on_true` if the associated value in `self` is true, and the values from `on_false` otherwise
src/wrappers/xla_op.rs:266
↓ 2 callers
Function
set_tf_min_log_level
(log_level: TfLogLevel)
src/lib.rs:63
↓ 2 callers
Method
shape
The [`Shape`] of the literal, this contains information about the dimensions of the underlying array, as well as the primitive type of the array's ele
src/wrappers/literal.rs:99
↓ 2 callers
Method
size_bytes
The literal size in bytes, this is the same as `element_count` multiplied by `element_size_in_bytes`.
src/wrappers/literal.rs:93
↓ 2 callers
Method
slice_in_dim
Create a node that has a partial view on the data of the original node. Indexes on the target dimension `dim` are restricted to the values between `st
src/wrappers/xla_op.rs:199
↓ 2 callers
Method
var_
( &mut self, s: &str, ty: ElementType, dims: &[usize], is_arg: bool,
examples/llama/var_store.rs:42
↓ 2 callers
Method
write
(&self, f: &mut T)
src/npy.rs:286
↓ 1 callers
Method
addressable_devices
A list of devices that can be used by this client.
src/wrappers/pjrt_client.rs:92
↓ 1 callers
Method
arg
(&mut self, s: &str, ty: ElementType, dims: &[usize])
examples/llama/var_store.rs:63
↓ 1 callers
Method
arg_indexes
(&self)
examples/llama/var_store.rs:98
↓ 1 callers
Method
as_env_variable_str
(&self)
src/lib.rs:53
↓ 1 callers
Method
bpe
(&self, s: &str)
examples/llama/sentencepiece.rs:88
↓ 1 callers
Method
bpe
(&self, token: &[u8])
examples/nanogpt/tokenizer.rs:333
↓ 1 callers
Method
buffer_from_host_buffer
Transfer some data from the host to a `PjRtBuffer` stored on the target device. If the device is not specified, the default device is used. The source
src/wrappers/pjrt_client.rs:104
↓ 1 callers
Function
build
xla_rs/xla_rs.cc:864
↓ 1 callers
Method
c1
Shorthand function for `constant_r1`.
src/wrappers/xla_builder.rs:129
↓ 1 callers
Method
c_shape
(&self)
src/wrappers/shape.rs:101
↓ 1 callers
Function
compile
xla_rs/xla_rs.cc:871
next →
1–100 of 409, ranked by callers