Class Aten
java.lang.Object
smile.torch.Aten
Calls any registered ATen operator by its schema name through the dispatcher
(
smile_aten_call), so models can use ops that have no dedicated binding:
Tensor c = Aten.one("aten::cat", new Tensor[]{a, b}, 1);
Tensor[] topk = Aten.call("aten::topk", x, 6, -1, true, true);
Tensor y = Aten.one("aten::masked_fill.Scalar", x, mask, Double.NEGATIVE_INFINITY);
Arguments follow the operator's schema order (see torch.ops.aten.<name>.<overload>._schema); trailing
arguments that are left out take their schema defaults. Accepted Java values: Tensor, null
(None), Boolean, Integer/Long (int or Scalar), Double/Float, String,
int[]/long[] (int[]), Tensor[] (Tensor[]), Aten.OptionalTensors (Tensor?[]) and
ScalarType (a dtype argument). Tensor results, and tensor lists flattened, are returned.
Calls run without autograd. Failures throw IllegalStateException with the native message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordATensor?[]argument, as taken byaten::index:nullentries become None. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConcurrentHashMap<String, long[]> Per-operator {calls, nanoseconds} when run with-Dsmile.aten.stats=true, elsenull. -
Method Summary
-
Field Details
-
STATS
Per-operator {calls, nanoseconds} when run with-Dsmile.aten.stats=true, elsenull.
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Returns true if the ATen dispatcher entry points are present insmile_torch.- Returns:
- true if
call(String, Object...)is supported by the loaded native library.
-
call
-
one
-