aesara.tensor.identity_like#

aesara.tensor.identity_like(x, dtype: Optional[Union[str, generic, dtype]] = None)[source]#

Create a tensor with ones on main diagonal and zeroes elsewhere.

Parameters:
  • x (tensor) –

  • dtype (data-type, optional) –

Returns:

tensor the shape of x with ones on main diagonal and zeroes elsewhere of type of dtype.

Return type:

tensor