Skip to Content
DocumentationFunctionalInit Opsinit_ops

init_ops

View the code on GitHub

Structs

Functions

array

array(dims: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • dims: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array
array(arr_str: StringLiteral, requires_grad: Bool = False) -> Array
more details
Args
  • arr_str: StringLiteral

  • requires_grad: Bool (default: False)

Returns
  • Array

tensor

tensor(dims: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • dims: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array
tensor(arr_str: StringLiteral, requires_grad: Bool = False) -> Array
more details
Args
  • arr_str: StringLiteral

  • requires_grad: Bool (default: False)

Returns
  • Array

ndarray

ndarray(dims: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • dims: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array
ndarray(arr_str: StringLiteral, requires_grad: Bool = False) -> Array
more details
Args
  • arr_str: StringLiteral

  • requires_grad: Bool (default: False)

Returns
  • Array

Tensor

Tensor(dims: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • dims: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array
Tensor(arr_str: StringLiteral, requires_grad: Bool = False) -> Array
more details
Args
  • arr_str: StringLiteral

  • requires_grad: Bool (default: False)

Returns
  • Array

arange_

arange_(mut arg: Array)
more details
Args
  • arg: Array

linspace

linspace(start: SIMD[float32, 1] = SIMD(0), end: SIMD[float32, 1] = SIMD(1), num: Int = 50, requires_grad: Bool = False) -> Array
more details
Args
  • start: SIMD[float32, 1] (default: SIMD(0))

  • end: SIMD[float32, 1] (default: SIMD(1))

  • num: Int (default: 50)

  • requires_grad: Bool (default: False)

Returns
  • Array

arange

arange(start: SIMD[float32, 1] = SIMD(0), end: SIMD[float32, 1] = SIMD(1), step: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • start: SIMD[float32, 1] (default: SIMD(0))

  • end: SIMD[float32, 1] (default: SIMD(1))

  • step: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

zeros_

zeros_(mut arg: Array)
more details
Args
  • arg: Array

zeros

zeros(shape: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array

zeros_like

zeros_like(arg: Array) -> Array
more details
Args
  • arg: Array
Returns
  • Array

ones_

ones_(mut arg: Array)
more details
Args
  • arg: Array

ones

ones(shape: List[Int], requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • requires_grad: Bool (default: False)

Returns
  • Array

ones_like

ones_like(arg: Array) -> Array
more details
Args
  • arg: Array
Returns
  • Array

eye_

eye_(mut arg: Array)
more details
Args
  • arg: Array

eye

eye(n: Int, requires_grad: Bool = False) -> Array
more details
Args
  • n: Int

  • requires_grad: Bool (default: False)

Returns
  • Array

eye_like

eye_like(arg: Array) -> Array
more details
Args
  • arg: Array
Returns
  • Array

fill_

fill_(mut arg: Array, value: SIMD[float32, 1])
more details
Args
  • arg: Array

  • value: SIMD[float32, 1]

full

full(shape: List[Int], value: SIMD[float32, 1], requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • value: SIMD[float32, 1]

  • requires_grad: Bool (default: False)

Returns
  • Array

fill_like

fill_like(arg: Array, value: SIMD[float32, 1]) -> Array
more details
Args
  • arg: Array

  • value: SIMD[float32, 1]

Returns
  • Array

indeces

indeces(shape: List[Int], stride: List[Int], storage_offset: Int, requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • stride: List[Int]

  • storage_offset: Int

  • requires_grad: Bool (default: False)

Returns
  • Array

randu_

randu_(mut arg: Array, min: SIMD[float32, 1] = SIMD(0), max: SIMD[float32, 1] = SIMD(1))
more details
Args
  • arg: Array

  • min: SIMD[float32, 1] (default: SIMD(0))

  • max: SIMD[float32, 1] (default: SIMD(1))

randu

randu(shape: List[Int], min: SIMD[float32, 1] = SIMD(0), max: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • min: SIMD[float32, 1] (default: SIMD(0))

  • max: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

randu_like

randu_like(mut arg: Array, min: SIMD[float32, 1] = SIMD(0), max: SIMD[float32, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • min: SIMD[float32, 1] (default: SIMD(0))

  • max: SIMD[float32, 1] (default: SIMD(1))

Returns
  • Array

randn_

randn_(mut arg: Array, mean: SIMD[float64, 1] = SIMD(0), std: SIMD[float64, 1] = SIMD(1))
more details
Args
  • arg: Array

  • mean: SIMD[float64, 1] (default: SIMD(0))

  • std: SIMD[float64, 1] (default: SIMD(1))

randn

randn(shape: List[Int], mean: SIMD[float64, 1] = SIMD(0), std: SIMD[float64, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • mean: SIMD[float64, 1] (default: SIMD(0))

  • std: SIMD[float64, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

randn_like

randn_like(mut arg: Array, mean: SIMD[float64, 1] = SIMD(0), std: SIMD[float64, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • mean: SIMD[float64, 1] (default: SIMD(0))

  • std: SIMD[float64, 1] (default: SIMD(1))

Returns
  • Array

rand_he_normal_

rand_he_normal_(mut arg: Array, fan_in: SIMD[float64, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

rand_he_normal

rand_he_normal(shape: List[Int], fan_in: SIMD[float64, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_he_normal_like

rand_he_normal_like(arg: Array, fan_in: SIMD[float64, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

Returns
  • Array

rand_he_uniform_

rand_he_uniform_(mut arg: Array, fan_in: SIMD[float32, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

rand_he_uniform

rand_he_uniform(shape: List[Int], fan_in: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_he_uniform_like

rand_he_uniform_like(arg: Array, fan_in: SIMD[float32, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

Returns
  • Array

rand_xavier_normal_

rand_xavier_normal_(mut arg: Array, fan_in: SIMD[float64, 1] = SIMD(1), fan_out: SIMD[float64, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

  • fan_out: SIMD[float64, 1] (default: SIMD(1))

rand_xavier_normal

rand_xavier_normal(shape: List[Int], fan_in: SIMD[float64, 1] = SIMD(1), fan_out: SIMD[float64, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

  • fan_out: SIMD[float64, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_xavier_normal_like

rand_xavier_normal_like(mut arg: Array, fan_in: SIMD[float64, 1] = SIMD(1), fan_out: SIMD[float64, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

  • fan_out: SIMD[float64, 1] (default: SIMD(1))

Returns
  • Array

rand_xavier_uniform_

rand_xavier_uniform_(mut arg: Array, fan_in: SIMD[float32, 1] = SIMD(1), fan_out: SIMD[float32, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

  • fan_out: SIMD[float32, 1] (default: SIMD(1))

rand_xavier_uniform

rand_xavier_uniform(shape: List[Int], fan_in: SIMD[float32, 1] = SIMD(1), fan_out: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

  • fan_out: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_xavier_uniform_like

rand_xavier_uniform_like(mut arg: Array, fan_in: SIMD[float32, 1] = SIMD(1), fan_out: SIMD[float32, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

  • fan_out: SIMD[float32, 1] (default: SIMD(1))

Returns
  • Array

rand_lecun_normal_

rand_lecun_normal_(mut arg: Array, fan_in: SIMD[float64, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

rand_lecun_normal

rand_lecun_normal(shape: List[Int], fan_in: SIMD[float64, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_lecun_normal_like

rand_lecun_normal_like(mut arg: Array, fan_in: SIMD[float64, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float64, 1] (default: SIMD(1))

Returns
  • Array

rand_lecun_uniform_

rand_lecun_uniform_(mut arg: Array, fan_in: SIMD[float32, 1] = SIMD(1))
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

rand_lecun_uniform

rand_lecun_uniform(shape: List[Int], fan_in: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

rand_lecun_uniform_like

rand_lecun_uniform_like(mut arg: Array, fan_in: SIMD[float32, 1] = SIMD(1)) -> Array
more details
Args
  • arg: Array

  • fan_in: SIMD[float32, 1] (default: SIMD(1))

Returns
  • Array

complex

complex(real: Array, imag: Array, requires_grad: Bool = False) -> Array
more details
Args
  • real: Array

  • imag: Array

  • requires_grad: Bool (default: False)

Returns
  • Array

randn_complex

randn_complex(shape: List[Int], mean: SIMD[float64, 1] = SIMD(0), std: SIMD[float64, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • mean: SIMD[float64, 1] (default: SIMD(0))

  • std: SIMD[float64, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

randu_complex

randu_complex(shape: List[Int], min: SIMD[float32, 1] = SIMD(0), max: SIMD[float32, 1] = SIMD(1), requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • min: SIMD[float32, 1] (default: SIMD(0))

  • max: SIMD[float32, 1] (default: SIMD(1))

  • requires_grad: Bool (default: False)

Returns
  • Array

fill_complex

fill_complex(shape: List[Int], value_real: SIMD[float32, 1], value_imag: SIMD[float32, 1], requires_grad: Bool = False) -> Array
more details
Args
  • shape: List[Int]

  • value_real: SIMD[float32, 1]

  • value_imag: SIMD[float32, 1]

  • requires_grad: Bool (default: False)

Returns
  • Array
Last updated on