license import { ENGINE } from '../engine' ; import { Reshape , ReshapeAttrs , ReshapeInputs } from '../kernel_names' ; import { NamedAttrMap } from '../kernel_registry' ; import { Tensor } from '../tensor' ; import { NamedTensorMap } from '../tensor_types' ; import { convertToTensor } from '../tensor_util_env' ; import { Rank , ShapeMap , TensorLike } from '../types' ; import { op } from './operation' ; param x param shape doc function reshape_ < R extends Rank > ( x , shape ) { const $x = convertToTensor ( x , 'x' , 'reshape' , 'string_or_numeric' ) ; const inputs = { x : $x } ; const attrs = { shape } ; return ENGINE . runKernel ( Reshape , inputs as { } as NamedTensorMap , attrs as { } as NamedAttrMap ) ; } export const reshape = op ( { reshape_ } ) ;