package fehu

  1. Overview
  2. Docs

Module Space.DiscreteSource

Sourcetype element = (int32, Nx.int32_elt) Nx.t

Discrete action represented as a scalar int32 tensor.

Sourceval create : ?start:int -> int -> element t

create ?start n is a discrete space with n choices in the range [start; start + n - 1]. start defaults to 0.

Raises Invalid_argument if n <= 0.

Sourceval n : element t -> int

n s is the number of choices in s.

Raises Invalid_argument if s is not a discrete space.

Sourceval start : element t -> int

start s is the starting value of s.

Raises Invalid_argument if s is not a discrete space.

Sourceval to_int : element -> int

to_int e is the integer value of the discrete element e.

Sourceval of_int : int -> element

of_int v is a discrete element with value v.